• Welcome to TechPowerUp Forums, Guest! Please check out our forum guidelines for info related to our community.

Help with running shortcut from task manager [solved]

Joined
Sep 27, 2019
Messages
1,208 (0.72/day)
Location
Canada
System Name New compy
Processor AMD Ryzen 5800x3D
Motherboard MSI MPG x570S EDGE MAX WiFi
Cooling Noctua NH-D15S w. FHP141 + Xigmatek AOS XAF-F1451
Memory 32gb G.Skill Ripjaws V Samsung B-Die Dual Rank F4-4000C16D-32GVKA
Video Card(s) ASUS TUF GAMING RTX 4070ti
Storage 17tb (8+4tb WD Black HDD's, 2+2+0.5+0.5tb M.2 SSD Drives) + 16tb WD Red Pro backup drive
Display(s) Alienware AW2518H 24" 240hz, Sony X85K 43" 4k 120hz HDR TV
Case Thermaltake Core v71
Audio Device(s) iFi Nano Idsd Le, Creative T20 + T50, Sennheiser HD6Mix
Power Supply EVGA Supernova G2 1000w
Mouse Logitech G502 Hero custom w. G900 scroll wheel mod, Rival 3 + Rival 3 wireless, JLab Epic Mouse
Keyboard Corsair K68 RGB + K70 RGB + K57 RGB Wireless + Logitech G613
Software Win 10 Pro
Benchmark Scores https://valid.x86.fr/s2y7ny
Here's my code saved as a vbs file

set x=createobject("wscript.shell")
x.run "%comspec% /k ""C:\PBO Tuner\PBO2 tuner Shortcut.lnk"""

Which works to run the shortcut with arguments intact but it leaves an open cmd window afterwards, adding exit and quit at the end produced errors running the script, also cannot get script to run from task manager, any help is appreciated.


Found part of the answer shortly after asking of course, new code.

Set ws = WScript.CreateObject("WScript.Shell")
ws.Run """C:\PBO Tuner\PBO2 tuner Shortcut.lnk"""

Still wont run from task manager...

Solved: Issue was with the VBS file name, it had a space in it and task manager doesn't like that, works fine now.
 
Last edited:

silentbogo

Moderator
Staff member
Joined
Nov 20, 2013
Messages
5,477 (1.43/day)
Location
Kyiv, Ukraine
System Name WS#1337
Processor Ryzen 7 3800X
Motherboard ASUS X570-PLUS TUF Gaming
Cooling Xigmatek Scylla 240mm AIO
Memory 4x8GB Samsung DDR4 ECC UDIMM
Video Card(s) Inno3D RTX 3070 Ti iChill
Storage ADATA Legend 2TB + ADATA SX8200 Pro 1TB
Display(s) Samsung U24E590D (4K/UHD)
Case ghetto CM Cosmos RC-1000
Audio Device(s) ALC1220
Power Supply SeaSonic SSR-550FX (80+ GOLD)
Mouse Logitech G603
Keyboard Modecom Volcano Blade (Kailh choc LP)
VR HMD Google dreamview headset(aka fancy cardboard)
Software Windows 11, Ubuntu 20.04 LTS
Issue was with the VBS file name, it had a space in it and task manager doesn't like that, works fine now.
Had to deal with similar thing last year, here's how you do it:
Code:
Set WshShell = CreateObject("WScript.Shell" )
WshShell.Run chr(34) & "path to PBO2tuner" & Chr(34)
Set WshShell = Nothing
This way it passes quotes to console, and you won't have issues with spaces anymore.
You can also pass other parameters to WshShell.run, like window style(normal, minimized, hidden, etc.), or whether the command should wait for program to exit (retuns an exit code).

For example, this will run PBO2tuner in background and won't wait for an exit code.
Code:
WshShell.Run chr(34) & "path to PBO2tuner" & Chr(34),0, false


Still wont run from task manager...
Same thing here, try quotes.
 
Top