PDA

View Full Version : .BAT script file



Glowrider
03-25-2003, 11:37 AM
Anyone know how to write a simple .BAT file that will run a program from the SYSVOL folder on a Win2k network?

rage2
03-25-2003, 12:01 PM
I used to be the .bat file king.

If it's a batch file that you want to run from the scripts folder :


@echo off
call "\\servername\SYSVOL\domain.com\scripts\startup.bat"

Replace servername and domain.com with your own names. If it's an exe file that needs to be called, or you don't want the batch file to continue (pass execution to the batch file in scripts), get rid of the call in line #2.

Glowrider
03-25-2003, 12:05 PM
So if I want an .exe file to run from the sysvol folder it's:

\\servername\sysvol\domain.com\scripts\patch.exe

?

rage2
03-25-2003, 12:09 PM
Originally posted by Glowrider
So if I want an .exe file to run from the sysvol folder it's:

\\servername\sysvol\domain.com\scripts\patch.exe

?

Close, it's :

"\\servername\sysvol\domain.com\scripts\patch.exe"

You have to use the " because of long filenames (most cases anyways).

Glowrider
03-25-2003, 12:11 PM
Is there a variable for "servername", since everything in the sysvol folder gets replicated to all domain controllers?

rage2
03-25-2003, 12:26 PM
just choose a domain controller for the server name.

sml
03-25-2003, 06:50 PM
Haha!!! I used to have a damn bat file for every little thing that I do... ie) run every single program from the root... good old days of edit, chkdsk, and dosshell... :rofl:

rage2
03-25-2003, 07:00 PM
I used to run a BBS! 2400 baud! batch files galore!

sml
03-26-2003, 06:32 PM
Hey, I had a BBS too, but I was running 9600 baud... Had to download picture files BEFORE you can view them, none of this "online" stuff! Imagine that... Back when Bill Gates just dropped out of school! haha!!! :rofl:

redec
03-26-2003, 07:35 PM
Originally posted by sml
Hey, I had a BBS too, but I was running 9600 baud... Had to download picture files BEFORE you can view them, none of this "online" stuff! Imagine that... Back when Bill Gates just dropped out of school! haha!!! :rofl:


hehe..."inline" :D


you still have to download them before viewing.....they just have the ability to be viewed inline now :P