Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions

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

Posted on 2011-02-19
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.

Question by:LeighWardle
  • 3
LVL 65

Accepted Solution

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.


LVL 65

Expert Comment

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.



Author Closing Comment

ID: 34935204
Thanks, Rob.

Pity about the rain in Melbourne.

LVL 65

Expert Comment

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

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

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…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

839 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