We help IT Professionals succeed at work.

Check out our new AWS podcast with Certified Expert, Phil Phillips! Listen to "How to Execute a Seamless AWS Migration" on EE or on your favorite podcast platform. Listen Now

x

using xcopy command

Medium Priority
448 Views
Last Modified: 2012-05-11
Hello, i am trying to compile a 'XCOPY' script which automatically copies 'modified' files to an alternative location.
I have used this but this copies all the files + folders
To copy a folder including all subfolders.
XCOPY C:\docs\* Y:\ /s /i

hope you can assist.
Comment
Watch Question

Commented:
Unlock this solution with a free trial preview.
(No credit card required)
Get Preview

Author

Commented:
kraiven
strange thing, cant seem to run the script. attached is what i get.  am i doing something wrong?
i have the xopy application file sitting in the C: drive
error.JPG

Commented:
Hmm! That's interesting - I've just tried it out and it works perfectly for me. It look s like the system is complaining about the wrong version of MS-DOS. what version do you have?

Author

Commented:
i am using DOS version 5.1.2600
where can i find a compatible xcopy ?
CERTIFIED EXPERT
Distinguished Expert 2019

Commented:
The xcopy command has been discussed in depth in the question below.

https://www.experts-exchange.com/OS/Microsoft_Operating_Systems/MS_DOS/Q_20814544.html

It seems that the xcopy command will not work exactly for what you want in command prompt of xp and you need a ms dos boot disk to boot up the system in order to make it work.

Commented:
Oh! I'm using a DOS shell from Windows XP. Ver: Microsoft Windows XP [Version 5.1.2600]????
Sikhumbuzo NtsadaIT Administration
Commented:
Unlock this solution with a free trial preview.
(No credit card required)
Get Preview

Author

Commented:
thanks both.
i have taken the code snipets you both having given... and found this
if i rename an existing file, xcopy copies the file to the target directory as a 'new' file, which is not right. should it not copy the renamed file and over-write it in the target directory ?
Sikhumbuzo NtsadaIT Administration

Commented:
If you re-named the file, then it's a new file and will be treated like that, if what you want is a script that looks at a file and copy the one with changes on it, then try vb scripts.
CERTIFIED EXPERT

Commented:
Mandev

The word "forkert" is Danish and Norwegian (possibly also other German-derived Baltic and Scandinavian languages) meaning "Wrong" and "Improper" respectively.  It doesn't seem to be a Dutch word, although possibly could have been used in Flemish and passed on to languages like Afrikaans.

I see you are in the UK.  Are you using a Danish or Norwegian version of Windows XP?

Just out of curiosity, and not related to your question, does B.S.A.P. mean anything to you?
CERTIFIED EXPERT

Commented:
I just noticed something.  You said:
"Am I doing something wrong? I have the xopy application file sitting in the C: drive".

By default in Windows XP XCOPY.EXE should be here:

C:\WINDOWS\system32\xcopy.exe

Check to see if it exists there and Right-Click on it > Properties.  The version should be (for a Windows XP SP3 system):
5.1.2600.5512 (xpsp.080413-2111)

If that file is OK, then I suggest you rename the xcopy.exe in the root of your C:\ Drive to something like "renamed_xcopy.exe".

If, after a couple of seconds, C:\xcopy.exe is replaced there, then it will have been replaced there from the "C:\Windows\System32\dllcache" folder because there is something screwy with where Windows originally installed the program file on your computer.

Let us know what happens.

Author

Commented:
all,
xcopy is working on some scripts.
However i cannot seem to copy this 'Outlook' folder to Y:\New Folder ??

xcopy "C:\Documents and Settings\mdass\Local Settings\Application Data\Microsoft\Outlook\" "Y:\New Folder" /S /E /C /Y /K /D /Z

nothing happens when i run the script....
Sikhumbuzo NtsadaIT Administration

Commented:
you might have problems if the application is open.

Author

Commented:
santasi24
No still does not work... all i'm trying to do is copy a folder with files to a network drive
?

Author

Commented:
slow response from experts, replies not accurate enough with little reasoning / grasp of the problem
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a free trial preview!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.