Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Running a VBscript file from a batch file - cannot get debugging output to screen

Posted on 2011-02-19
4
Medium Priority
?
1,472 Views
Last Modified: 2012-05-11
Hi Experts,

I am running a VBscript file from a batch file.
The batch file is being called by a login batch file.

I am trying to have the VBscript output debugging text to the screen then wait for a button to be clicked.


I have tried msgbox and WshShell.Popup but in all cases the VBscript runs to completion without the debugging outputs.

Regards,
Leigh
0
Comment
Question by:LeighWardle
  • 3
4 Comments
 
LVL 65

Accepted Solution

by:
RobSampson earned 2000 total points
ID: 34935159
Hi Leigh,

How is the VBS called from your batch file?  Something like:
wscript.exe "\\server\share\myscript.vbs"

That should allow WScript.Echo, WshShell.Popup, or MsgBox statements to display on screen.

One reason it might not however, is if the //B switch has been set as the default for your VBS files, which is for "batch" mode, meaning all output is suppressed.

Try it with:
wscript.exe //I "\\server\share\myscript.vbs"

and if that works, then to make it permanently behave that way, try running:
wscript.exe //S "\\server\share\myscript.vbs"

first, to effectively set no options as the default behaviour, and then your batch should work.

Regards,

Rob.
0
 
LVL 65

Expert Comment

by:RobSampson
ID: 34935179
Actually, you should probably be able to kill two birds with one stone by just running in your batch:
wscript.exe //I //S "\\server\share\myscript.vbs"

to make the interactive switch the default.

Regards,

Rob.
0
 
LVL 1

Author Closing Comment

by:LeighWardle
ID: 34935204
Thanks, Rob.

Pity about the rain in Melbourne.

Regards,
Leigh
0
 
LVL 65

Expert Comment

by:RobSampson
ID: 34935213
Glad to help.  The rain's not so bad when it doesn't come down in buckets...nice steady rain is good....
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Hello again, all.  For those of you that have been following along, you'll know that this is my third article on this topic (though it is not Part III).  This article is sort of remedial, and probably the topic with which I should have started the s…
Welcome, welcome!  If you are new to the series and haven't been following along, please take a brief moment to review the first three installments: Part 1 (http://www.experts-exchange.com/Programming/Languages/Visual_Basic/VB_Script/A_266-VBScri…
Integration Management Part 2
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…

916 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question