Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am new to batch file programming and need an expert help to find out something. I want to create a batch file that runs at login and compares a local copy of the templates to what we have on the network. We have templates on a mapped network drive in h:\clients\templates, and on the laptop in c:\apps\data\clients\templates. When the laptop is offline it substitutes c:\apps\data to appear as h: drive, that way the files appear to be in h:\clients\templates. Here’s the basic steps what I need the batch file for:

  1. first it checks to see if the computer is on the network
  2. if it’s online it copies any newer files from Server onto the local drive
  3. if it’s not online it uses the local files and has them show up on the laptop as the same location as the network

I really appreciate any help/suggestions..

Thank you in advance, Hemal

share|improve this question

Wouldn't it be much easier to use Windows Offline Folders to give you this behaviour automatically?

share|improve this answer
It should also point the templates to the same location as my network drive as our application looks for the network path for the templates.... – Hemal Mar 2 '10 at 20:41
@Hemal, a properly configured Offline Folders setup should do that. – Zoredache Mar 2 '10 at 21:17

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.