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
Windows 跳过批处理脚本中的错误消息_Windows_Batch File - Fatal编程技术网

Windows 跳过批处理脚本中的错误消息

Windows 跳过批处理脚本中的错误消息,windows,batch-file,Windows,Batch File,我有一个非常简单的批处理脚本 Start "" "C:\Game.exe" 如果Game.exe不存在,它将显示一条错误消息,说明没有Game.exe。我想跳过这样的消息,我的意思是,如果game.exe存在,它会运行它,如果没有什么 怎么做?例如: 如果不存在“C:\Game.exe”转到错误1 启动“”“C:\Game.exe” :error 1例如: if exist "C:\Game.exe" Start "" "C:\Game.exe" 如果不存在“C:\Game.exe”转到错误

我有一个非常简单的批处理脚本

Start "" "C:\Game.exe"
如果Game.exe不存在,它将显示一条错误消息,说明没有Game.exe。我想跳过这样的消息,我的意思是,如果game.exe存在,它会运行它,如果没有什么

怎么做?

例如:

如果不存在“C:\Game.exe”转到错误1

启动“”“C:\Game.exe”

:error 1

例如:

if exist "C:\Game.exe" Start "" "C:\Game.exe"
如果不存在“C:\Game.exe”转到错误1

启动“”“C:\Game.exe”

:错误1

if exist "C:\Game.exe" Start "" "C:\Game.exe"