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_Windows 10 - Fatal编程技术网

Batch file 如何启动批处理文件

Batch file 如何启动批处理文件,batch-file,windows-10,Batch File,Windows 10,我想知道如何在不创建快捷方式的情况下启动一个最小化的批处理文件 我还想知道如何在不使用VBS的情况下最小化重新启动批处理文件的代码 因此,如果有人知道如何启动从第一次启动起就最小化的批处理文件,那就太好了。尝试使用和: 通过添加一些powershell @echo off echo This batch will minimize and return to normal in 5 second intervals. timeout /t 5 >nul powershell -window

我想知道如何在不创建快捷方式的情况下启动一个最小化的批处理文件

我还想知道如何在不使用VBS的情况下最小化重新启动批处理文件的代码

因此,如果有人知道如何启动从第一次启动起就最小化的批处理文件,那就太好了。

尝试使用和:


通过添加一些
powershell

@echo off
echo This batch will minimize and return to normal in 5 second intervals.
timeout /t 5 >nul
powershell -window minimized -command ""
timeout /t 5 >nul
powershell -window normal -command ""
echo and We're back..
如果您只想使用批处理,那么错误的方法,因为我们实际上不
启动
批处理文件,应该是:

start "" /min "batchfilename.cmd"
如果从另一个批处理文件运行此操作,则该批处理文件将保持打开状态,除非您退出它。因此,为了在实际的批处理文件中运行它,它将类似于:

echo Hello!
if not DEFINED IS_MINIMIZED set IS_MINIMIZED=1 && start "" /min "%~0" %* && exit
timeout /t 10
exit

这里的超时只给了您一些时间,让您看到窗口运行最小化。

什么操作系统?@fpmurphy windows 10
echo Hello!
if not DEFINED IS_MINIMIZED set IS_MINIMIZED=1 && start "" /min "%~0" %* && exit
timeout /t 10
exit