2015年8月26日 星期三

批次檔-大量修改密碼

CLS
@ECHO Off
COLOR 70
MODE CON COLS=65 LINES=40
REG ADD "HKEY_CURRENT_USER\SOFTWARE\Microsoft\Command Processor" /v "DelayedExpansion" /t REG_DWORD /d 1 /f > nul
REG ADD "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Command Processor" /v "DelayedExpansion" /t REG_DWORD /d 1 /f > nul
ECHO ----------------------------------------------------------------
ECHO     正在自動設定密碼....
ECHO ----------------------------------------------------------------
for /F "tokens=1,2 delims=, " %%i in (D:\acc.csv) do (
set username=%%i&set password=%%j
echo     正在設定 !username! 帳號之密碼為 !password!...
start /wait net user !username! !password! /domain
echo     設定完畢...
echo.
)
pause
rem REG DELETE "HKEY_CURRENT_USER\SOFTWARE\Microsoft\Command Processor" /v "DelayedExpansion" /f > nul
rem REG DELETE "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Command Processor" /v "DelayedExpansion" /f > nul 
exit

沒有留言:

張貼留言