0
運行我的批處理文件時,我目前收到這些錯誤:FOR/F錯誤不讀書的.csv {批處理文件}
System error 1379 has occurred.
The specified local group already exists.
Press any key to continue . . .
The system cannot find the file users.csv. {This is where my problem lies}
Press any key to continue . . .
There is no such global user or group: users.csv
我的批處理文件
@echo off
REM Adding a local group
net localgroup NEWDOSGROUP /Comment:"New Group Assignment" /add
pause
REM Add all the users from a .csv file
FOR /F "tokens=1,2 delims=," %%G IN (users.csv) DO (
net adduser
pause
REM Adding users to a local group
FOR /F "tokens=1,2 delims=," %%a IN ("users.csv") Do (
net localgroup NEWDOSGROUP %%a /add
)
pause
任何幫助將是驚人的感謝。
FOR/F「%% G的參數或%% H或tokens = 1,2 delims =,「%% G IN(users.csv)DO(net adduser %% G %% H) 試過這個問題仍然出現系統無法找到文件,即使它在同一目錄中? – user2848630
'FOR/F「tokens = 1,2 delims =,」%% G IN(users.csv)DO echo %% G %% H' < - 嘗試並確保文件具有相同的名稱有'users.csv'和三重檢查它。 – foxidrive
ive三重檢查,甚至用該命令仍然說 系統找不到文件users.csv。 – user2848630