Skip to content

Instantly share code, notes, and snippets.

@rileyz
Created March 5, 2019 10:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rileyz/9cef8a17700a9933c47983630601415e to your computer and use it in GitHub Desktop.
Save rileyz/9cef8a17700a9933c47983630601415e to your computer and use it in GitHub Desktop.
'SYNOPSIS
'Script to execute a application without showing a black (Command Prompt) or blue (PowerShell)
'dialog box. Written to handle spaces within the the path and executable name.
'LINK
'Author:.......https://www.linkedin.com/in/rileylim
'Source Code:..https://gist.github.com/rileyz/9cef8a17700a9933c47983630601415e
'# Setting up housekeeping for variables ###########################################################
'Set the executable name below.
ExecutableName = "NameOfApplication.exe"
'#<<< End of Setting up housekeeping >>>
'# Start of script work ############################################################################
CurrentDirectory = CreateObject("Scripting.FileSystemObject").GetParentFolderName(WScript.ScriptFullName)
ExecuteNow = chr(34) & CurrentDirectory & "\" & ExecutableName & chr(34)
CreateObject("WScript.Shell").Run ExecuteNow
'<<< End of script work >>>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment