防止 VBscript 应用程序显示控制台窗口 [英] Prevent VBscript app from showing Console Window
本文介绍了防止 VBscript 应用程序显示控制台窗口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个 VBScript 应用程序可以创建符号链接.
I have a VBScript app which create Symbolic Links.
Set wshell = CreateObject("WScript.Shell")
.....
linkcmd = "mklink /D """ & linkFolderPath & "\" & linkName & """ """ & libfolder & "\" & folderName & """"
cmd = "cmd /C " & linkcmd
wshell.Run cmd, 4, true
这很好并且有效,但是当我创建很多链接时,每次执行 wshell.Run
命令都会导致一个临时控制台窗口出现并迅速消失.
This is fine and works, but when I create a lot of links, each execution of the wshell.Run
command results in a transient console window appearing and promptly vanishing.
有没有办法阻止控制台窗口被创建得如此明显?
Is there anyway to prevent the console window from being created so visibly?
推荐答案
您可以使用这个 VBScript 来运行隐藏的 cmd 命令,只需将其合并到您的脚本中即可:
You can use this VBScript to run cmd commands hidden, just incorporate it into your script:
Set objShell = WScript.CreateObject("WScript.Shell")
objShell.Run "cmd /c yourcommands", 0, True
这篇关于防止 VBscript 应用程序显示控制台窗口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文