Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/batch-file/6.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
Windows 批处理文件以调用所有其他批处理文件_Windows_Batch File - Fatal编程技术网

Windows 批处理文件以调用所有其他批处理文件

Windows 批处理文件以调用所有其他批处理文件,windows,batch-file,Windows,Batch File,如何创建一个“万事俱备”批处理文件,该文件只需调用其目录中的所有批处理文件,然后一个接一个地执行它们 我尝试使用 for /r %%i in (*.bat) do call %%i 失败得很惨,因为很明显,文件迟早会调用自己,并最终陷入一个无休止的循环,一次又一次地调用自己 如何更好地管理它?只需在for循环中使用if语句: for /r %%i in (*.bat) do (if "%~dpnx0" NEQ "%%~i" call "%%i") 只需在for循环中使用if语句: for /

如何创建一个“万事俱备”批处理文件,该文件只需调用其目录中的所有批处理文件,然后一个接一个地执行它们

我尝试使用

for /r %%i in (*.bat) do call %%i
失败得很惨,因为很明显,文件迟早会调用自己,并最终陷入一个无休止的循环,一次又一次地调用自己


如何更好地管理它?

只需在for循环中使用if语句:

for /r %%i in (*.bat) do (if "%~dpnx0" NEQ "%%~i" call "%%i")

只需在for循环中使用if语句:

for /r %%i in (*.bat) do (if "%~dpnx0" NEQ "%%~i" call "%%i")

只需在for循环中使用if语句:

for /r %%i in (*.bat) do (if "%~dpnx0" NEQ "%%~i" call "%%i")

只需在for循环中使用if语句:

for /r %%i in (*.bat) do (if "%~dpnx0" NEQ "%%~i" call "%%i")
您有两种解决方案:

将起始bat文件重命名为
.CMD

您有两种解决方案:

将起始bat文件重命名为
.CMD

您有两种解决方案:

将起始bat文件重命名为
.CMD

您有两种解决方案:

将起始bat文件重命名为
.CMD


您可以使用
%~nx0
从“主”文件检索文件名。也许您可以在forloop中的if中使用它来跳过“main”文件?您可以使用
%~nx0
从“main”文件中检索文件名。也许您可以在forloop中的if中使用它来跳过“main”文件?您可以使用
%~nx0
从“main”文件中检索文件名。也许您可以在forloop中的if中使用它来跳过“main”文件?您可以使用
%~nx0
从“main”文件中检索文件名。也许您可以在forloop中的if中使用它来跳过“main”文件?