Login Batch

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
JamesHB
Posts: 1
Joined: 28 Jul 2011 20:19

Login Batch

#1 Post by JamesHB » 28 Jul 2011 20:28

Hi,

I'm a bit rusty with my cmd line batches and just wanted to get some feedback on a batch.

@echo off
echo *
echo Copying Software Program Files.... Please wait
xcopy \\myserver\Software c:\ProgramX /d /u /y /I>c:\ProgramX\xcopy.out

I want to add functionality where it will;

- contact myserver on login and determine it has the most up to date version of the files (.exes) in the ProgramX folder
- if the files have been deleted/never existed, replace them
- it needs to run as a login script so I would prefer it didnt do anything unnecessary like overwrite anything unchanged etc.

I guess I want some feedback (before I give this to my boss) on whether I can improve on this batch or maybe I should be using Robocopy?

Thanks guys

dbenham
Expert
Posts: 2461
Joined: 12 Feb 2011 21:02
Location: United States (east coast)

Re: Login Batch

#2 Post by dbenham » 29 Jul 2011 07:44

The /U option is incompatible with (opposite of) your requirement:
- if the files have been deleted/never existed, replace them


Dave Benham

Post Reply