需要帮助从另一个批处理无形中运行批处理 [英] Need Help running a batch invisibly from another batch
问题描述
我有一个批处理文件,命名为x.bat,我需要它y.bat隐形运行
这是
x.bat
I have A batch file named x.bat, i need it to run y.bat invisibly This is x.bat
@ECHO off
echo CreateObject("Wscript.Shell").Run """" & WScript.Arguments(0) & """", 0, False>invisible.vbs
wscript.exe invisible.vbs y.bat
y.bat
@ECHO off
dir>good.txt
pause
当我运行x.bat它正在创建invisible.vbs但它不是无形打开y.bat
如何克服这个问题
When i run x.bat it is creating invisible.vbs but it is not opening y.bat invisibly How to overcome this problem
推荐答案
解决方法1:修改文件
另存为文本文件 invisible.vbs
的这一行:
Save this one line of text as file invisible.vbs
:
CreateObject("Wscript.Shell").Run """" & WScript.Arguments(0) & """", 0, False
要隐形运行任何程序或批处理文件,使用这样的:
To run any program or batch file invisibly, use it like this:
wscript.exe "C:\Wherever\invisible.vbs" "C:\Some Other Place\MyBatchFile.bat"
要还能够通过开/继电器的参数列表仅使用两个双引号
To also be able to pass-on/relay a list of arguments use only two double quotes
CreateObject("Wscript.Shell").Run "" & WScript.Arguments(0) & "", 0, False
例如: Invisible.vbsKill.vbs ME.exe
解决方案2:
使用命令行工具以默默启动一个进程:静音
, hidecon
或 hideexec。
Use a command line tool to silently launch a process : Quiet
, hidecon
or hideexec.
这篇关于需要帮助从另一个批处理无形中运行批处理的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!