Last active
November 5, 2018 15:24
-
-
Save silverkorn/1c10526cbba9b10d48af27327ac5501e to your computer and use it in GitHub Desktop.
Hide terminal pop up on Windows, like for Node's `pkg` binary output.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Dim objShell, objFSO, objFile, strArguments | |
Set objShell = WScript.CreateObject("WScript.shell") | |
Set objFSO = CreateObject("Scripting.FileSystemObject") | |
Set objFile = objFSO.GetFile(WScript.ScriptFullName) | |
For Each strArgument in WScript.Arguments | |
strArguments = strArguments & " " & strArgument | |
Next | |
objShell.Run """" & objFSO.GetParentFolderName(objFile) & "\" & objFSO.GetBaseName(WScript.ScriptFullName) & ".exe""" & strArguments, 0, False |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Just put it in the same directory as the executable and give it the same name but with the
.vbs
extension and use this script instead for your potential desktop shortcut.This suggestion might not work properly with quoted arguments. If so, you might want to include this instead if judged necessary :
https://stackoverflow.com/questions/31095570/what-is-the-or-argument-list-equivalent-for-vbscript#answer-31100398
Or
https://stackoverflow.com/questions/40056204/how-do-i-get-raw-vbscript-command-line-arguments#answer-40056793