Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

holding command window open using vbscript 1

Status
Not open for further replies.

FPTech619

IS-IT--Management
Nov 21, 2011
4
US
Hello All,

Currently the firewall that the company that I recently started working for uses a batch file to authenticate the users to the filter and to put them into the correct filtering groups. I can tell when the batch file has run because it starts a service. It is currently being pushed out via group policy but I'm having issues with it not running, so I am trying to run the batch file in my logon scripts. I currently use the following code at the beggining of my logon scripts to call two files; one to disconnect all mapped network drives and one to call my batch file:

Dim objNetwork, objUser, CurrentUser,objShell
Dim strGroup, strFilename, errTrap

...
'Disconect mapped network drives
Set objShell = CreateObject("WScript.Shell")
objShell.Run "wscript \\MY DOMAIN\netlogon\Disconnect_ALL_mapped_drives.vbs", , True
'run M86 filter batch file
objShell.Run "cscript \\MY DOMAIN\netlogon\M86\logonhelper.bat"
...

Both commands run but the batch file doesn't execute properly. I can see it open a command prompt window but it closes before I can see what is being displayed.
I know that the batch file works because if I navigate to \\MY DOMAIN\netlogon\m86 and run the batch file the service starts without error.

Is there a way that I can specify not to close the command prompt window so that I can see what is not working?
 
Replace this:
objShell.Run "cscript \\MY DOMAIN\netlogon\M86\logonhelper.bat"
with this:
objShell.Run "\\MY DOMAIN\netlogon\M86\logonhelper.bat"

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top