Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/csharp-4.0/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Batch file 将/i开关与在for循环中运行的if命令结合使用时出错_Batch File - Fatal编程技术网

Batch file 将/i开关与在for循环中运行的if命令结合使用时出错

Batch file 将/i开关与在for循环中运行的if命令结合使用时出错,batch-file,Batch File,我得到以下错误: The following usage of the path operator in batch-parameter substitution is invalid: %~xI"==".URL" (start /B "%%I" "%PROGNAME%\Internet Expl orer\iexplore.exe" "%%I") For valid formats type CALL /? or FOR /? The syntax of the command is in

我得到以下错误:

The following usage of the path operator in batch-parameter
substitution is invalid: %~xI"==".URL" (start /B "%%I" "%PROGNAME%\Internet Expl
orer\iexplore.exe" "%%I")


For valid formats type CALL /? or FOR /?
The syntax of the command is incorrect.
我的代码是:

for %%I in (%CD%\Startup\*) do IF /i "%~xI"==".URL" (start /B "%%I" "%PROGNAME%\Internet Explorer\iexplore.exe" "%%I") ELSE (start /B "%%I" "%%I")

我正在尝试将.url文件与其他扩展名放在同一目录中,并对url文件运行一个命令,对其他文件运行一个单独的命令,以强制url文件在单独的浏览器窗口中打开。

如果很难看到,
“%~xI”
应该是
“%~xI”
如果恩多的回答能解决你的问题,请接受它。
for %%I in ("%CD%\Startup\*") do IF /i "%%~xI"==".URL" (start /B "%%~I" "%PROGNAME%\Internet Explorer\iexplore.exe" "%%~I") ELSE (start /B "%%~I" "%%~I")