Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/windows/16.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 我想在没有可见命令提示的情况下从.bat文件运行第三方.exe文件_Windows_Batch File_Vbscript - Fatal编程技术网

Windows 我想在没有可见命令提示的情况下从.bat文件运行第三方.exe文件

Windows 我想在没有可见命令提示的情况下从.bat文件运行第三方.exe文件,windows,batch-file,vbscript,Windows,Batch File,Vbscript,首先,我创建了VBScript,以便在没有可见命令提示的情况下运行批处理文件 代码如下: Set WshShell=CreateObject(“WScript.Shell”) WshShell.Run Chr(34)和(“D:\Intouch\u Printer\u SW\spool12\splotext.bat”)&Chr(34),0 设置WshShell=Nothing 以下是我运行第三方.exe文件的批处理文件代码 (C:\WINDOWS\system32\spool\PRINTERS\

首先,我创建了VBScript,以便在没有可见命令提示的情况下运行批处理文件

代码如下:

Set WshShell=CreateObject(“WScript.Shell”)
WshShell.Run Chr(34)和(“D:\Intouch\u Printer\u SW\spool12\splotext.bat”)&Chr(34),0
设置WshShell=Nothing
以下是我运行第三方.exe文件的批处理文件代码

(C:\WINDOWS\system32\spool\PRINTERS\*.SPL)中%%f的
do(
回声%%~nf
启动“D:\Intouch\U打印机\U SW\spool12\spool.exe”C:\WINDOWS\system32\spool\PRINTERS\%%~nf.SPL“Intouch打印机”
)
每当我运行.vbs代码时,就会弹出一个控制台窗口,我希望在没有可见命令提示的情况下完成所有操作

我想我得到了一个黑色的窗口,因为这个片段:

start“D:\Intouch\u Printer\u SW\spool12\spool.exe”C:\WINDOWS\system32\spool\PRINTERS\%~nf.SPL“Intouch打印机”
在新窗口中打开命令。运行控制台应用程序不需要它,因此您可以简单地删除它:

(C:\WINDOWS\system32\spool\PRINTERS\*.SPL)中%%f的
do(
回声%%~nf
D:\Intouch\U Printer\U SW\spool12\spool.exe“C:\WINDOWS\system32\spool\PRINTERS\%%~nf.SPL”“Intouch打印机”
)
此外,我建议从VBScript同步运行批处理脚本(将
Run
方法的第三个参数设置为
True
),以避免任何人修改VBScript时产生不希望的副作用

Set WshShell=CreateObject(“WScript.Shell”)
WshShell.Run“”“D:\Intouch\u Printer\u SW\spool12\splotext.bat”“,0,True

您是否尝试过呼叫而不是启动?除此之外,您可以使用
start/Min
最小化命令行窗口。谢谢!谢谢。成功了。两者中哪一个?我想补充一个答案:)