0

我正在使用下面的批处理脚本,但我不断收到错误“/此时意外。”

有任何想法吗?

谢谢

@ Echo off 
set n_user =%%%% username password;
c:\windows\system32\find / n "%% n_user" C:\Users\Voyager\Desktop\server installs\OpenVPN\config\list.txt> result.txt 
for / f "skip = 1"%% a in (result.txt) do set n =%% a
if "% s%" == "----------" exit 1
exit 0
4

1 回答 1

3

删除(should be ) 和(should be )之间的空格 /和 switch 字符。(您还有其他几个空格问题。我也已修复它们。您还需要将包含空格字符的路径名括在双引号中。)/ n/n/ f/f

@ Echo off 
set n_use =%%%% username password;
c:\windows\system32\find /n "%%n_user" "C:\Users\Voyager\Desktop\server installs\OpenVPN\config\list.txt"> result.txt 
for /f "skip=1" %%a in (result.txt) do set n=%%a
if "%s%" == "----------" exit 1
exit 0
于 2012-11-15T14:06:54.507 回答