xcopy not recognised from xp batch file

January 13, 2011 at 20:40:44
Specs: Windows XP, Athlon 64/512 MB
I've been given a small batch file for copying only altered or new documents to an external hard drive for backup. The batch file calls "xcopy" which returns an error message saying xcopy not a recognised internal or external command. Maybe xcopy is not available from WinXP, in which case I shall have to approach the requirement from a different angle!

See More: xcopy not recognised from xp batch file

Report •

January 13, 2011 at 23:20:06
Xcopy is available in xp....

Can you please post the output of these commands:

@dir "%systemroot%\system32\xcopy.exe"

It sounds like your using the system %path% variable for something other than intended.

Report •

January 14, 2011 at 10:45:00
Many thanks for prompt reply. I get the command outputs on the screen OK but they are long and complicated. Please remind me how to print them t a file which I can send to you. I used to do a little DOS programming but I have forgotten more than I rememer!
Meanwhile I will keep on trying (not without risk!)
I can remember how to make a PrintScreen; I will try to make a file of that and send it to you.
Thanks again,
Bill gm8apx

Report •

January 14, 2011 at 15:34:41
Thank-you again. I have succeeded in getting the answers to your questions into a .txt file, which I will now try to paste:
Tpot.txt 14/01/2011 23:26

Volume in drive C is DRIVE C
Volume Serial Number is D80B-EC52

Directory of C:\DOCUME~1\COMPAQ~1.001

14/01/2011 22:29 <DIR> .
14/01/2011 22:29 <DIR> ..
11/08/2010 11:32 <DIR> .gegl-0.0
24/12/2010 23:10 <DIR> .gimp-2.6
24/12/2010 23:08 923 .recently-used.xbel
11/08/2010 11:33 <DIR> .thumbnails
03/11/2010 05:44 <DIR> Application Data
12/01/2011 11:03 92 default.pls
14/01/2011 22:30 <DIR> Desktop
19/09/2010 03:29 <DIR> Favorites
14/01/2011 18:58 <DIR> My Documents
13/01/2011 08:39 8,388,608 ntuser.dat
14/01/2011 20:11 586 outputs.txt
11/07/2010 19:43 <DIR> Start Menu
14/01/2011 22:29 972 tpot1.txt
01/01/2004 09:46 <DIR> WINDOWS
5 File(s) 8,391,181 bytes
11 Dir(s) 109,098,639,360 bytes free
Volume in drive C is DRIVE C
Volume Serial Number is D80B-EC52

Directory of C:\WINDOWS\system32

14/04/2008 00:12 30,720 xcopy.exe
1 File(s) 30,720 bytes
0 Dir(s) 109,098,086,400 bytes free
Volume in drive C is DRIVE C
Volume Serial Number is D80B-EC52

Directory of C:\WINDOWS\system32

14/04/2008 00:12 30,720 xcopy.exe
1 File(s) 30,720 bytes
0 Dir(s) 109,098,082,304 bytes free
Press any key to continue . . .

Hope all this helps; meanwhile I am learning and re-learning, which is always a pleasure at my age!
Best wishes,
Bill, gm8apx

Report •

Related Solutions

January 14, 2011 at 15:51:45
This is pretty horrible, and I'm going to (probably unjustly) blame Nero. Run these commands, and give us the results:
reg query HKCU\Environment /v path
reg query "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment" /v path

How To Ask Questions The Smart Way

Report •

January 14, 2011 at 16:24:24
Hi. Many thanks for helping.

Tried your commands; got "reg is not recognised as an internal or external command".

Meanwhile I have replied to Judago; you can see my reply to him, and I think you already have done.

Yes, I too suspect "Nero"; but whether or not they have corrupted my system and deleted a few commands along the way, I don't know.


Bill, gm8apx

Report •

January 14, 2011 at 16:39:10
%systemroot%\system32\reg query HKCU\Environment /v path
%systemroot%\system32\reg query "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment" /v path

How To Ask Questions The Smart Way

Report •

January 14, 2011 at 17:51:49
What you posted is very helpful, now we know that:

1. xcopy.exe exists where it should.
2. That %pathext% is fine.
3. That %comspec% is fine.
4. That %path% is screwed up.

I also want to see the output of the two commands that Razor2.3 posted in #6 to be certain before attempting to fix, though this would be my suggested path



You can copy from the console:

Quick Edit Disabled: Right click in the console -> select "mark" -> follow the "quick edit enabled" steps.

Quick edit enabled: Left click and hold -> drag over the text -> release left click -> right click. (The text should now be on the clipboard).

Report •

January 14, 2011 at 19:52:12
I wonder if it would be easier to just change the path from the gui, rather than trying to fix the associated registry entries?


Advanced tab
Environment Variables button
System Variables section
Select path
Hit edit

Report •

January 14, 2011 at 22:39:27
Continuing thanks!
Latest responses: To "%systemroot%\system32\reg query HKCU\Environment /v path" I get: "unable to find specified registry key or value".

To the longer entry I get: "! REG.EXE VERSION 3.0

At this stage I have to plead Cold Feet, because I have not lost any of the facilities I need daily, and I am fearful of making things worse by trying to fix it.

Nevertheless, many thanks both for the help. I have gained a better insight into what is possible, and how.

Bill, gm8apx

Report •

January 14, 2011 at 22:53:25
Well you wouldn't be loosing much, at most quicktime and nero.

I will say this much however, if you don't fix it you are very likely to face future problems.

You don't have to do it by gui, a script can do it without too much trouble.

Is that really all the output of the second command?

Report •

January 14, 2011 at 23:22:55
I would have preferred to see the output of the second reg command,
but I'm 99% sure so here goes:

This should fix it just be sure to save it as a batch script,
don't run the commands from the command line.

I tested this on my system and it worked fine.

@echo off
Rem This must be run as a batch script
rem Do not run commands seperatly at the
rem command line

"%systemroot%\system32\reg" query "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment" /v path > "%homepath%\desktop\pathbackup.txt"

"%systemroot%\system32\reg.exe" add "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment" /f /v path /t REG_EXPAND_SZ /d "%%SystemRoot%%\system32;%%SystemRoot%%;%%SystemRoot%%\System32\Wbem;C:\PROGRA~1\QUICKT~1\QTSystem;C:\PROGRA~1\COMMON~1\Nero\Lib"

echo You must restart for changes to take effect.

Report •

January 15, 2011 at 00:56:49
Yes! Success! And the batch program I had in the first place (to copy new or altered doc files etc to an external HD) is now working.

You have saved me no end of time, trouble, risk and worry.

Also the Cold Feet which I had about batch files are now comfortably warm!

I have kept your batch program on file in case I need it again.

I read on the Web that there have been several problems with Nero, and that they blame Microsoft.

Thanks again -

Bill, gm8apx

Report •

January 15, 2011 at 01:32:05
No problem, I'm happy to help.

I wouldn't use it again, unless you haven't installed anything and the path got screwy again. The reason for this is that there may be new entries to the path from other programs.

As it is there may be programs installed that should have a directory on the path, but don't because I don't know about them. At least you have the "base set"(windows directories) on top of nero/quicktime.

Also I'm glad you no longer have cold feet, though I must warn not to change the registry unless you know what you doing...

Report •

Ask Question