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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

calling vbscript through .bat file

Status
Not open for further replies.
Mar 25, 2004
146
US
I use .bat files of login scripts. I need to call a .vbs script file from that .bat file....anyone know how.

-Ryan
 
Hello NetworkAdmin123,

Just add the line (with path if necessary) at proper place in the .bat.

cscript abc.vbs //B //Nologo

It would be suitable for batch mode (no user interactive).

regards - tsuji
 
Here is my bat file with your command added in...it's still not working. the .vbs file is in the scripts folder.

C:
set logfile="\\SNSERVER\Loginlog\UserLogIn\%username%.txt"
echo %date% %time% %computername% >> %logfile%


set logfile="\\SNSERVER\Loginlog\ComputerLogIn\%computername%.txt"
echo %date% %time% %username% >> %logfile%

NET USE F: \\SNSERVER\APPS
NET USE G: \\SNSERVER\Shared
net use lpt1: \\Lender2\610

@echo off

Net Use B: \\SNSERVER\pplogon

start B:\cookiepatrol.exe /NoLog /NoSound

start B:\ppmemcheck.exe /auto /delete

start B:\pestpatrolcl.exe c:\ /wait=300 /Info /idle /nologafter /Delete /Nopause

REM ***** NORTON ANTIVIRUS *****

NET USE V: \\SNSERVER\SYSVOL\OMNB.LOCAL\SCRIPTS
V:
vplogon.bat
cscript 610.vbs //B //Nologo

cls


exit
 
what scripts folder?
you mean in V:
surely you dont need to map a drive to call the vbscript
why not
cscript.exe \\SNSERVER\SYSVOL\OMNB.LOCAL\SCRIPTS\610.vbs

 
Hello NetworkAdmin123,

I see you have a bare .bat line above. Hence, it can pose problem if the .bat's construction is arbitrary. In that case, I would propose you to use as well a start to control the return of control to the original session. (Even call is not suffice to guarantee the automatic pass back the control.)
Code:
start vplogon.bat
cscript 610.vbs //B //Nologo
regards - tsuji
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top