Here is some example code I have right now to launch an app:
Set objShell = Wscript.CreateObject("WScript.Shell")
objShell.Run """C:\Program Files\Handbrake\HandBrakeCLI.exe"""
I tried the following to launch the app minimized but it didn't work. I'm assuming this only works from a normal command prompt?
Set objShell = Wscript.CreateObject("WScript.Shell")
objShell.Run "start /MIN ""C:\Program Files\Handbrake\HandBrakeCLI.exe"""
I've also tried launching a shortcut (which just gave a null error and the script couldn't run) as well as trying to do a sendkeys
to minimize it which didn't work at all.
This is from a VBScript running via cscript.exe by the way.
Does anyone know how I can start this app minimized within VBScript?
Check the docs and use the second parameter of the .Run method.
Evidence:
set s = createobject("WScript.Shell")
s.run "notepad", 2
starts Notepad minimized.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With