Solved

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

Posted on 2011-02-19
4
1,426 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 500 total points
Comment Utility
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
Comment Utility
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
Comment Utility
Thanks, Rob.

Pity about the rain in Melbourne.

Regards,
Leigh
0
 
LVL 65

Expert Comment

by:RobSampson
Comment Utility
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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

This is an addendum to the following article: Acitve Directory based Outlook Signature (http://www.experts-exchange.com/Programming/Languages/Visual_Basic/VB_Script/Q_24950055.html) The script is fine, and works in normal client-server domains…
I met Paul Devereux (@pdevereux) today when I responded to his tweet asking “Anybody know how to automate adding files from disk to a folder in #outlook  ?”.  I replied back and told Paul that using automation, in this case scripting, to add files t…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

763 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

Need Help in Real-Time?

Connect with top rated Experts

6 Experts available now in Live!

Get 1:1 Help Now