How to launch a program from a VBS file (500pts)

I have a batch file that I can double click to start a certain program. I want to advertise this program via GPO but since the program continues to run after it launches the logon script window never disappears with a batch file. I think launching the program from a VBS file will fix this.

This seems like it should be a really simple script. Basically I want to launch the program from %logonserver%/netlogon with some switches. So for example program.exe /switch1 /switch2 /switch3

Im not too good with VB scripting so looking for someone to help me out here.

Thanks
LVL 35
Joseph DalyAsked:
Who is Participating?
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.

newborn1281Commented:
Set objShell = CreateObject("WScript.Shell")
objShell.Exec "wuauclt.exe /resetauthorization /detectnow"

look at this example
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
Joseph DalyAuthor Commented:
Tried that when I run it on my local PC it works fine. When I set it to the logon script in the GPO it comes up with an error. Could not located the filepath where the executable is listed even though I know it is correct.
0
newborn1281Commented:
how are you reaching executable ? \\servername\drive\folder\    ?
0
Introducing Cloud Class® training courses

Tech changes fast. You can learn faster. That’s why we’re bringing professional training courses to Experts Exchange. With a subscription, you can access all the Cloud Class® courses to expand your education, prep for certifications, and get top-notch instructions.

Steve KnightIT ConsultancyCommented:
Try running it from the batch file as

START "" "\\server\share\yourprog.exe /arg1 /arg2"

then it will pass control to the other program then continue to the next entry in the batch file without stopping.

etc.
0
Joseph DalyAuthor Commented:
Tried that and I dont get any error messages but the program does not launch. No entries in the event viewer or anything.
0
newborn1281Commented:
The only difference between the script above and the second script we showed you is that we changed objShell.Run to objShell.Exec. Yet, when you run this script, it appears to do nothing. You don't even see a window quickly flash open. Instead you see nothing at all. Would you believe us if we told you that ipconfig was actually being run? Well, don't take our word for it, instead, add a redirection symbol (>), followed by a text file name after the call to ipconfig. That will cause the output of the command to be put in the file. If you're not used to redirection, think of it this way: if we're telling you the truth and ipconfig is running, then it is creating it's standard text display. Unfortunately, we can't see it. The redirection will allow us to capture any output and force it into a file. This will help us verify whether or not the ipconfig command is being run. This next script rounds up our output for us.
0
newborn1281Commented:
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.