troubleshooting Question

help with VBS script start a .exe

Avatar of maurice cristen
maurice cristen asked on
VB Script
5 Comments1 Solution155 ViewsLast Modified:
this is the script:
Set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.Run C:\Users\root\Music\folder\mytool.exe
WScript.Sleep 1000
WshShell.SendKeys "{LEFT}"
WshShell.SendKeys "{LEFT}"
WshShell.SendKeys "{TAB}"
WshShell.SendKeys "{SPACE}"

I want this:
I want to run as administrator and then i do this?
i open mytool.exe and ..left arrow twice then i press TAB then i press space to start automatically my exe
but doesn't work i receive this error, can someone help me please?

script: C:Users\root\Desktop\start1.vbs
Line: 2
Char: 16
Error: Expected statement
Code: 800A0400
Source: Microsoft VBScript compilation error
Join our community to see this answer!
Unlock 1 Answer and 5 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 5 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros