当我通过path
作为我的第二个参数时,出现以下错误。看起来问题在于空间。批处理文件错误:“此时文件意外。”
Files was unexpected at this time
我执行批处理文件与下面的参数
services.cmd 2 "C:\Program Files (x86)\folder\Folder\folder\Bin" corp\acct password
CODE:
@echo off
if "%1" == "" goto PARAMS
if "%2" == "" goto PARAMS
if "%3" == "" goto PARAMS
if "%4" == "" goto PARAMS
sc create "<service name>"%1 binpath= "\%2\xxx.exe\" \"xxx.exe.config\""
rem sc config "<service name>"%1 displayname= "<display name>"%1 obj= %3 password= %4 start= auto description= "Runs the service."
goto END
:PARAMS
echo Usage CreateServices.cmd binfoldername binfolderpath username password
:END
您能否提供批处理文件的代码和您传递的路径的值? –