Can you launch a vbs script from a bat file logon script

I have a logon bat file now and need to remap printers in MS Active Directory to a new server. I have worked with vbs logon scripts but never bat logon scripts, so can I call a vbs script from a logon script that is in bat format. Then let the vbs script remap the printers.
pointhighAsked:
Who is Participating?
 
RobSampsonConnect With a Mentor Commented:
ghostdog74 is right.

In a batch file (or from the DOS prompt, for testing), you can run
   cscript \\server\netlogon\script.vbs
for the DOS version of Windows Script Host (which shows a DOS prompt briefly)
and you can also use
   wscript \\server\netlogon\script.vbs
for the Windows version of Windows Script Host (which will not show the DOS window)

Regards,

Rob.
0
 
jax79sgCommented:
There shouldn't be any problems. In fact i think you can place the vbs files in the logon script folder without a need for a batch file.
*vbs files are executable in windows*
0
 
ghostdog74Connect With a Mentor Commented:
generally to call vbscript from bat file,

cscript <scriptname>
0
Cloud Class® Course: Certified Penetration Testing

This CPTE Certified Penetration Testing Engineer course covers everything you need to know about becoming a Certified Penetration Testing Engineer. Career Path: Professional roles include Ethical Hackers, Security Consultants, System Administrators, and Chief Security Officers.

 
pointhighAuthor Commented:
Thanks for that information, it looks to be what I am looking for. One other part is what is does the vbs script pass back control to the bat login script when it finishes or do I have to do that in the vbs script. Also does the bat login script wait for the vbs script to finish?

I have increased the points to 250 because of the added question.
Pointhigh
0
 
RobSampsonConnect With a Mentor Commented:
When you call the VBS from your batch file, the script will be executed, but the batch file will continue to run the rest of it's commands.

If you want the batch file to wait for the script to finish before running its other commands, use
start /wait wscript \\server\netlogon\script.vbs

instead.

Regards,

Rob.
0
 
pointhighAuthor Commented:
Thanks that was the information I was looking for.
Pointhigh
0
 
RobSampsonCommented:
No problem, thanks Pointhigh.

Regards,

Rob.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.