batch file question

nomak

Limp Gawd
Joined
Oct 20, 2004
Messages
419
I wrote a batch file that I can run from my laptop to copy or sychronize my files from my desktop to my laptop. My question is did I write the code or commands properly.. It seems to be working but sometimes it grabs some files that I know I havent changed and recopies them to my laptop..

example of code..


@echo on
xcopy/d/e/r/v/y "\\Computer name\c\Documents and Settings\computer user\My Documents" "C:\Documents and Settings\computer user\My Documents"
pause

computer name and computer user are used to substitute whats really being used. where computer name line points to my desktop ...
 
try the /c switch. I think that will do only ones that have changed.

i use the following in mine xcopy /c /s /r /d /y /i
 
i dont think dos likes the documents and settings thing

what is it! i cant remember for sure. c:\document~1\ or something like that? i have one at work and ill try to remember to repost on monday.
 
t00thless said:
i dont think dos likes the documents and settings thing

what is it! i cant remember for sure. c:\document~1\ or something like that? i have one at work and ill try to remember to repost on monday.

That's what the quotation marks are for. Without them then you'd have to trunkate it to 8 characters...
 
I just learned something as well.. there is a "a" switch and "m" switch the a switch only copies files with the archive bit set but doest not clear the archive bit.. kinda like differential backup. the m switch copies files with the archive bit set but clears the archive bit once it has been copied.. hence just like a full back up would do .
 
Back
Top