help with VBS script start a .exe

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}"

Open in new window


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

Open in new window

maurice cristenAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Bill PrewCommented:
Try:

WshShell.Run "C:\Users\root\Music\folder\mytool.exe"


»bp
0
Jessica KCommented:
Hey Maurice,

As such, I haven't seen an issue like this but, while searching for your query I have got an informative article regarding the same.
Follow the steps, give in the blog to resolve this problem.

https://www.techwalla.com/articles/how-to-run-exe-in-vbscript
0
maurice cristenAuthor Commented:
i finally can open mytool.exe here the script but problem with Line 4 ''tab''
here the script
Set objShell = WScript.CreateObject( "WScript.Shell" )
objShell.Run("""C:\Users\root\Music\folder\soft.exe""")
WScript.Sleep 6000
WshShell.SendKeys "{LEFT}"
WshShell.SendKeys "{LEFT}"
WshShell.SendKeys "{TAB}"
WshShell.SendKeys "^{ }"

Open in new window


here the error:
script: C:Users\root\Desktop\start1.vbs
Line: 4
Char: 16
Error: Object required:"WshShell"
Code: 800A01AB
Source: Microsoft VBScript runtime error

Open in new window

0
Bill PrewCommented:
Should be:

Set objShell = WScript.CreateObject( "WScript.Shell" )
objShell.Run("""C:\Users\root\Music\folder\soft.exe""")
WScript.Sleep 6000
objShell.SendKeys "{LEFT}"
objShell.SendKeys "{LEFT}"
objShell.SendKeys "{TAB}"
objShell.SendKeys "^{ }"

Open in new window


»bp
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
maurice cristenAuthor Commented:
ok
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
VB Script

From novice to tech pro — start learning today.