where can I find a list of Windows XP copy errorlevels
(e.g. "not enough disk space")
Thank You
Joachim
> where can I find a list of Windows XP copy errorlevels
> (e.g. "not enough disk space")
You want the error messages?
If you describe why you need them then someone might come up with an
idea that helps you.
--
Regards,
Mic
I d need something like
copy a b
if errorlevel 5 do delete_old_files_cause_of_little_space
copy a b_new attempt
or should I catch the literal errror message instead?
This would be "Es steht nicht genug Speicherplatz auf dem Datenträger zur Verfügung."
- Joachim
Unless I'm mistaken, the COPY command doesn't return an errorlevel
other than 0.
XCOPY does, though, and so is to be preferred.
0 - All files were copied without errors
1 - No files were found to copy (invalid source)
2 - XCOPY was terminated by Ctrl-C before copying was complete
4 - An initialization error occurred.
Such an error would generally caused by insufficient memory or disk
space, or invalid drive name (invalid target) or syntax.
5 - A disk-write error occurred.
To really do the job properly, might I suggest ROBOCOPY?
Xcopy errorlevels are documented. I couldn't find copy errorlevels in a
quick search but xcopy will do the same thing.
http://technet.microsoft.com/en-us/library/bb491035.aspx
--
Regards,
Mic
> Unless I'm mistaken, the COPY command doesn't return an errorlevel
> other than 0.
It does return an errorlevel on failure in XP SP3 at least.
D:\>echo %errorlevel%
0
D:\>copy boot.ini a.ini
1 file(s) copied.
D:\>echo %errorlevel%
0
D:\>copy oot.ini b.ini
The system cannot find the file specified.
D:\>echo %errorlevel%
1
--
Regards,
Mic
COPY.EXE returning only success or failure. 0 or 1
Your batch also works fine with XP Home Edition 2nd edition.
Andy
Looks like you can get more errorlevels with xcopy.
xcopy /r/y l:\test.zzz z.abc
echo %errorlevel%
C:\Backup>xcopy /r/y l:\test.zzz z.abc
Invalid drive specification
0 File(s) copied
C:\Backup>echo 4
4
C:\Backup>
s/COPY.EXE/COPY
>where can I find a list of Windows XP copy errorlevels
>(e.g. "not enough disk space")
Google for list of errorlevels and the first of the 416000000
results is not far from what you want - just read on ...
Google Advanced Search for list of Windows XP copy errorlevels
within the past year jives just 2320000 to read through. including
<http://en.wikipedia.org/wiki/COMMAND.COM> with useful links. And for
list of CMD.EXE errorlevels just 202.
--
(c) John Stockton, Surrey, UK. ?@merlyn.demon.co.uk Turnpike v6.05 MIME.
Web <http://www.merlyn.demon.co.uk/> - FAQish topics, acronyms, & links.
Proper <= 4-line sig. separator as above, a line exactly "-- " (SonOfRFC1036)
Do not Mail News to me. Before a reply, quote with ">" or "> " (SonOfRFC1036)