Solved

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

Posted on 2011-02-19
4
1,461 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
[X]
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
  • 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering 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

In this article we want to have a look at the directory attributes which are used by Microsoft to store the so called Security Identifiers (SID). These SIDs plays an important role in delegating and granting permissions and in authentication of trus…
This article is the result of a quest to better understand Task Scheduler 2.0 and all the newer objects available in vbscript in this version over  the limited options we had scripting in Task Scheduler 1.0.  As I started my journey of knowledge I f…
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…
Suggested Courses

739 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