Help with batch file

G

Guest

i have 3 domain controllers and have a logon.bat file in each netlogon share
which points to the folder on each individual domain controller which
contains the main executable script.
The batch file contains:

@ECHO OFF
Start \\domaincontroller1\policies\Policies.exe /w

but for redundancy i would like each DC to point to its own local
policies.exe. How do i do this as through replication the logon.bat is
changing and all the DC's contain the same text, whereas I need them to point
to their local exe.
Is there a better way to script this?
 
R

Ray Costanzo [MVP]

You could use:

start %logonserver%\policies\policies.exe /w

Since the script will be interpreted and run by the client machine, it's up
to the client machine to determine which machine it should look to. And
%logonserver% is the DC that that client machine is authenticating against
at that moment.

Ray at work
 
G

Guest

good solution, thats the sort of thing i was looking for
it seems to work, even though the command window says:
'\domaincontroller1\netlogon'
CMD.EXE was started with the above path as the current directory. UNC paths
are not supported. Defaulting to Windows directory.
I can view this after putting a PAUSE statement in.
I dont suppose I need to worry though, as long as it works.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top