(http://www.windows-commandline.com/)
net user username password /ADD /FULLNAME:"User_Fullname"
net localgroup administrators username /add
wmic path Win32_UserAccount where Name='username' set PasswordExpires=false
or for the system
net accounts /MAXPWAGE:UNLIMITED
- Finding computer name using IP
REM Simple scan in batch
FOR /L %%G IN (200,1,236) DO CALL :sub1 %%G
:sub1
echo ------------------ 192.168.0.%1 ---------------- >> loc_net.txt
NBTSTAT -A 192.168.0.%1 >> loc_net.txt
- Add a rule
netsh firewall set portopening protocol=TCP port=5800 name=vnc5800 mode=ENABLE profile=All
or
netsh advfirewall firewall add rule name="vnc5800" dir=in action=allow protocol=TCP localport=5800
netsh advfirewall firewall add rule name="FireBird3050" dir=in action=allow protocol=TCP localport=3050
- Check it
netstat -na -p tcp|findstr 3050
( http://www.robvanderwoude.com/loginscripts.php )
- Connect network drives
NET USE H: \\CompanyServer\%UserName% /PERSISTENT:No IF ERRORLEVEL 1 ( ECHO Error mapping drive H: )
- Short local path under c:\Program Files\
for %%f in ("%cd%") do SET LOCALPATH=%%~sf
systeminfo > info.txt
- Finding disconnected sessions with qwinsta or query
qwinsta /server:theserver_or_ip
- Killing disconnected sessions with rwinsta or reset
rwinsta sessionid /server:theserver_or_ip
How to change the System Regional Settings in Windows(VBS)
When the script finishes running, Windows Console will display brief information about the script to let you know the execution result.
Note
Please replace the following data before you execute the script.
strCountry = "United States"
strshortDateValue = "M/d/yyyy"
strlongDateValue = "dddd, MMMM d, yyyy"
strshortTimeValue = "h:mm tt"
strlongTimeValue = "h:mm:ss tt"
strfirstDayOfWeekValue = "6"
And we can only set the number to the 'FirstDayOfWeek' parameter, for example in English format, details as follow:
6 – Sunday
0 – Monday
1 – Tuesday
2 – Wednesday
3 – Thursday
4 – Friday
5 - Saturday
Const HKEY_CURRENT_USER = &H80000001
strComputer = "."
Set objRegistry = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & strComputer & "\root\default:StdRegProv")
regKeyPath = "Control Panel\International"
strCountry = "United States"
strshortDateValue = "M/d/yyyy"
strlongDateValue = "dddd, MMMM d, yyyy"
strshortTimeValue = "h:mm tt"
strlongTimeValue = "h:mm:ss tt"
strfirstDayOfWeekValue = "6"
objRegistry.SetStringValue HKEY_CURRENT_USER, regKeyPath, "sCountry", strCountry
objRegistry.SetStringValue HKEY_CURRENT_USER, regKeyPath, "sShortDate", strshortDateValue