Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/batch-file/5.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 无法执行批处理脚本_Batch File - Fatal编程技术网

Batch file 无法执行批处理脚本

Batch file 无法执行批处理脚本,batch-file,Batch File,下面是我试图执行的脚本,但双击批处理文件后,它会打开命令窗口,命令提示符立即消失 CD /D C:\RAJA_WORKSPACE\NTLePrismAutomation\NTLePrismAutomation\ePrismReports\ for /f "eol=: delims=" %F in ('dir /b /od *.html') do @set "newest=%F" "%newest%" 尽管我认为您不需要eol选项。批处理文件需要双%用于令牌,而在命令提示下,它们必须是单令牌

下面是我试图执行的脚本,但双击批处理文件后,它会打开命令窗口,命令提示符立即消失

CD /D C:\RAJA_WORKSPACE\NTLePrismAutomation\NTLePrismAutomation\ePrismReports\

for /f "eol=: delims=" %F in ('dir /b /od *.html') do @set "newest=%F"

"%newest%"

尽管我认为您不需要
eol
选项。批处理文件需要双
%
用于
令牌,而在命令提示下,它们必须是单令牌。

非常感谢@npocmaka您的回答对我帮助很大lot@rajaram如果您觉得某个答案有助于解决您的问题,请通过选择答案左侧的灰色勾号选择正确答案。是我再次勾选感谢您的贡献@npocmakai如果您阅读了
for
命令的帮助文件,您可以回答自己的问题。
CD /D C:\RAJA_WORKSPACE\NTLePrismAutomation\NTLePrismAutomation\ePrismReports\

for /f "eol=: delims=" %%F in ('dir /b /od *.html') do @set "newest=%%F"

"%newest%"