Solved

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

Posted on 2011-02-19
4
1,436 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
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Not long ago I saw a question in the VB Script forum that I thought would not take much time. You can read that question (Question ID  (http://www.experts-exchange.com/Programming/Languages/Visual_Basic/VB_Script/Q_28455246.html)28455246) Here (http…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Internet Business Fax to Email Made Easy - With  eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, f…
Both in life and business – not all partnerships are created equal. As the demand for cloud services increases, so do the number of self-proclaimed cloud partners. Asking the right questions up front in the partnership, will enable both parties …

911 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

18 Experts available now in Live!

Get 1:1 Help Now