Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Prevent VBscript app from showing Console Window

Tags:

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

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?

like image 687
BonyT Avatar asked Oct 30 '12 15:10

BonyT


1 Answers

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
like image 178
Bali C Avatar answered Oct 18 '22 03:10

Bali C