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 在后台运行bat文件_Batch File - Fatal编程技术网

Batch file 在后台运行bat文件

Batch file 在后台运行bat文件,batch-file,Batch File,我想在后台运行bat文件。我在谷歌上搜索,发现了一些使用hstart和cmdow的例子。但是windows命令不也是这样吗?我真的很好,当我不添加额外的程序到我的项目! thanx提前这实际上取决于您使用的编程语言和平台 在Windows中,使用.NET平台上的C#语言,它是: System.Diagnostics.Process.Start(@"C:\myfile.bat"); 我正在使用窗口调度程序。我找到了一个方法: 将这一行文本另存为文件invisible.vbs: CreateObj

我想在后台运行bat文件。我在谷歌上搜索,发现了一些使用hstart和cmdow的例子。但是windows命令不也是这样吗?我真的很好,当我不添加额外的程序到我的项目!
thanx提前

这实际上取决于您使用的编程语言和平台

在Windows中,使用.NET平台上的C#语言,它是:

System.Diagnostics.Process.Start(@"C:\myfile.bat");

我正在使用窗口调度程序。我找到了一个方法:

将这一行文本另存为文件invisible.vbs:

CreateObject("Wscript.Shell").Run """" & WScript.Arguments(0) & """", 0, False
要以不可见的方式运行任何程序或批处理文件,请如下使用:

wscript.exe "C:\Wherever\invisible.vbs" "C:\Some Other Place\MyBatchFile.bat"

thanx

您可以尝试将批处理文件作为windows服务运行。要做到这一点,您可能需要在主机上安装admin previleges,但如果您想这样做,可以使用sc命令轻松添加/配置

另见