There's no such thing as a stupid question, but they're the easiest to answer.
JoinTour
Login
 
Tag Cloud
access audio avg avg 8 bios boot browser bsod computer cpu crash css dell desktop driver dvd email error excel explorer firefox firefox 3 freeze gimp graphics hard drive hardware help please hijackthis hjt install internet internet explorer itunes javascript keyboard lan laptop log malware monitor network networking openoffice outlook outlook 2003 password php popups problem router seo slow sound sp3 spyware startup trojan usb video virtumonde virus vista vundo windows windows vista windows xp winxp wireless youtube
Business Applications
Search
Search in:
 
Advanced Search
Tech Support Guy Forums > Software & Hardware > Business Applications >
Using XCOPY In windows 2000


HELLO AND WELCOME! Before you can post your question, you'll have to register -- it's completely free! Click here to join today! We highly recommend that you print a copy of our Guide for New Members. Enjoy!

 
Thread Tools
aboone2's Avatar
Junior Member with 8 posts.
 
Join Date: May 2008
09-May-2008, 11:37 AM #1
Using XCOPY In windows 2000
I need to write a command that will archive (copy all files and folders) that is on a drive on my computer once and then the next time I run the same command only copy the files that have changed. I know that I need to use XCOPY but I cant get the switches to work right. I need to copy from Z:\ to E:\ Can any one help. I would even settle for two commands one for the first time and and another for the second time.
slurpee55's Avatar
Computer Specs
Distinguished Member with 3,387 posts.
 
Join Date: Oct 2004
Location: Southwest Iowa....
Experience: Currently stupid...
09-May-2008, 12:30 PM #2
You probably need to use a wildcard the first time (*)
You might look into Robocopy (see here: http://www.ss64.com/nt/robocopy.html ) for copying the changed files - the best that Xcopy offers along those lines is the /D:mm-dd-yyyy switch, which copies files that have changed since the data mm-dd-yyyy (the default is at least one day before today)
__________________
Iowa? I could have sworn this was heaven.
Well, I think I can answer this question most successfully in mime.

My theme song...
aboone2's Avatar
Junior Member with 8 posts.
 
Join Date: May 2008
09-May-2008, 01:30 PM #3
RE: Using XCOPY IN Window 2000
Thanks,

How Do I set it up so it just copies the files that have change within the last day like you said was defult and can that be a batch file?

Thanks
kiwiguy's Avatar
Distinguished Member with 17,071 posts.
 
Join Date: Aug 2003
Location: New Zealand
11-May-2008, 02:35 AM #4
You need the /d switch, if you do not specify a date (just use /d) then it will only be copied if the date is later.
http://support.microsoft.com/kb/289483
Plantsman's Avatar
Senior Member with 152 posts.
 
Join Date: Jan 2008
Experience: Intermediate
11-May-2008, 05:16 PM #5
A full list of XCOPY command switches

XCOPY source [destination] [/A | /M] [/D[:date]] [/P] [/S [/E]] [/V] [/W] [/C] [/i] [/Q] [/F] [/L] [/H] [/R] [/T] [/u] [/K] [/N] [/O] [/X] [/Y] [/-Y] [/Z] [/EXCLUDE:file1[+file2][+file3]...]

source Specifies the file(s) to copy.
destination Specifies the location and/or name of new files.
/A Copies only files with the archive attribute set, doesn't change the attribute.
/M Copies only files with the archive attribute set, turns off the archive attribute.
/D:m-d-y Copies files changed on or after the specified date. If no date is given, copies only those files whose source time is newer than the destination time.
/EXCLUDE:file1[+file2][+file3]... Specifies a list of files containing strings. When any of the strings match any part of the absolute path of the file to be copied, that file will be excluded from being copied. For example, specifying a string like \obj\ or .obj will exclude all files underneath the directory obj or all files with the .obj extension respectively.
/P Prompts you before creating each destination file.
/S Copies directories and subdirectories except empty ones.
/E Copies directories and subdirectories, including empty ones. Same as /S /E. May be used to modify /T.
/V Verifies each new file.
/W Prompts you to press a key before copying.
/C Continues copying even if errors occur.
/I If destination does not exist and copying more than one file, assumes that destination must be a directory.
/Q Does not display file names while copying.
/F Displays full source and destination file names while copying.
/L Displays files that would be copied.
/H Copies hidden and system files also.
/R Overwrites read-only files.
/T Creates directory structure, but does not copy files. Does not include empty directories or subdirectories. /T /E includes empty directories and subdirectories.
/U Copies only files that already exist in destination.
/K Copies attributes. Normal Xcopy will reset read-only attribute
/N Copies using the generated short names.
/O Copies file ownership and ACL information.
/X Copies file audit settings (implies /O).
/Y Suppresses prompting to confirm you want to overwrite an existing destination file.
/-Y Causes prompting to confirm you want to overwrite an existing destination file.
/Z Copies networked files in restartable mode.

The switch /Y may be preset in the COPYCMD environment variable. This may be overridden with /-Y on the command line.
__________________
Plant something for Earth's sake.
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are Off
Refbacks are Off

You Are Using:
Server ID
Advertisements do not imply our endorsement of that product or service.
All times are GMT -4. The time now is 06:18 AM.
Copyright © 1996 - 2008 TechGuy, Inc. All rights reserved.
Powered by vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Powered by Cermak Technologies, Inc.