Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

XCOPY errorlevels?

1,242 views
Skip to first unread message

Rick Charnes

unread,
Mar 22, 2001, 5:14:55 PM3/22/01
to
I'm writing a batch file for NT 4.0 that uses XCOPY. Does XCOPY return
errorlevels for things like 'file not found', 'disk write error', etc.,
that I can use in the batch file? Thanks.

Anthony Borla

unread,
Mar 23, 2001, 1:17:04 AM3/23/01
to
"Rick Charnes" <rick.c...@thehartford.com> wrote in message
news:MPG.1524436cf...@News.CIS.DFN.DE...

> I'm writing a batch file for NT 4.0 that uses XCOPY. Does XCOPY return
> errorlevels for things like 'file not found', 'disk write error', etc.,
> that I can use in the batch file? Thanks.

The following provides a demonstration of 'xcopy' errorlevels.

I hope this helps.

@echo off

xcopy whatever wherever
if errorlevel 5 goto 5
if errorlevel 4 goto 4
if errorlevel 2 goto 2
if errorlevel 1 goto 1

:ok
echo Files were copied without error.
goto exit

:1
echo No files were found to copy.
goto exit

:2
echo The user pressed CTRL+C to terminate xcopy.
goto exit

:4
echo Not enough memory or disk space, or invalid drive name or syntax.
goto exit

:5
echo Disk write error occurred.

:exit

Rick Charnes

unread,
Mar 23, 2001, 9:11:05 AM3/23/01
to
Thanks very much; where do you find such information?

In article <xRAu6.1619$45....@newsfeeds.bigpond.com>,
ajb...@bigpond.com says...

Outsider

unread,
Mar 23, 2001, 9:40:03 AM3/23/01
to
Rick Charnes wrote:
>
> Thanks very much; where do you find such information?
>

No secret. This information is part of DOS 6.x help files that
ship(ped) with MS-DOS.

More:

http://users.cybercity.dk/~bse26236/batutil/help/INDEX.HTM
MS-DOS v6.22 Help: Command Reference

http://vernon.frazee.net/ms-dos/6.22/help/index.htm
MS-DOS v6.22 Help: Command Reference

http://www3.sympatico.ca/rhwatson/dos7/
Dos7 Commands - Index Page

http://support.microsoft.com/support/ms-dos/serviceware/dos62/dos62.asp
MS DOS 6.22 Product support

http://support.microsoft.com/support/ms-dos/serviceware/dos7/dos70.asp
MS DOS 7.0 Product support

http://www.microsoft.com/technet/maintain/msdos.asp
MS-DOS Maintenance

http://www.microsoft.com/technet/MSDOS/technote/dosnet.asp
How to Set Up the MS Network Client Version 3.0 for MS-DOS

http://www.microsoft.com/technet/MSDOS/reskit/01_intro.asp
Supplemental disk information

http://www.microsoft.com/technet/MSDOS/reskit/suppdisk.asp
DOS supplemental utilities help

http://www.microsoft.com/technet/MSDOS/reskit/02_setup.asp
Setup, Using Setup /F

http://www.microsoft.com/technet/MSDOS/reskit/03_confg.asp
Working with Startup Files

http://www.microsoft.com/technet/MSDOS/reskit/04_dblsp.asp
DoubleSpace Integrated Compression

http://www.microsoft.com/technet/MSDOS/reskit/05_memry.asp
Memory Management

http://www.microsoft.com/technet/MSDOS/reskit/06_other.asp
Other Programs and Features

http://www.microsoft.com/technet/MSDOS/reskit/07_refer.asp
MS-DOS 6 Command Reference

http://www.microsoft.com/technet/MSDOS/reskit/comm1.asp
Commands: Ansi.sys - Dblspace.sys

http://www.microsoft.com/technet/MSDOS/reskit/comm2.asp
Commands: Debug - Ega.sys

http://www.microsoft.com/technet/MSDOS/reskit/comm3.asp
Commands: Emm386 - Expand

http://www.microsoft.com/technet/MSDOS/reskit/comm4.asp
Commands: Fasthelp - Format

http://www.microsoft.com/technet/MSDOS/reskit/comm5.asp
Commands: Goto - Mode(Set Typematic Rate)

http://www.microsoft.com/technet/MSDOS/reskit/comm6.asp
Commands: More - Rename (ren)

http://www.microsoft.com/technet/MSDOS/reskit/comm7.asp
Commands: Replace - SMARTDRV.EXE

http://www.microsoft.com/technet/MSDOS/reskit/comm8.asp
Commands: Sort - Xcopy

http://support.microsoft.com/support/ms-dos/serviceware/dos62/76LPE8FD2.ASP
Batch files, executables and macros

http://support.microsoft.com/support/ms-dos/serviceware/dos62/76JG2XQO7.ASP
MS DOS 6.22 Commands

http://support.microsoft.com/support/ms-dos/serviceware/dos62/76LP8JL2K.ASP
Disk managment

http://support.microsoft.com/support/ms-dos/serviceware/dos62/76LPE6IUC.ASP
Diskettes

http://support.microsoft.com/support/ms-dos/serviceware/dos62/76LP7NHMA.ASP
Files and directories

http://support.microsoft.com/support/ms-dos/serviceware/dos62/76LPK0EUA.ASP
Memory

http://www.nukesoft.co.uk/msdos/
MS-DOS Reference

--
<!-Outsider//->
MS-DOS 6.22, Windows for Workgroups 3.11, Netscape Navigator 4.08
MS-DOS 7.1, Windows 4.1 (a.k.a. 98), Netscape Navigator 4.74

Frank-Peter Schultze

unread,
Mar 23, 2001, 1:07:37 PM3/23/01
to
"Outsider" <nonvali...@yahoo.com> schrieb im Newsbeitrag
news:3ABB6043...@yahoo.com...

> Rick Charnes wrote:
> >
> > Thanks very much; where do you find such information?
>
> No secret. This information is part of DOS 6.x help files that
> ship(ped) with MS-DOS.
>
> More:

[Useful bookmarks snipped]

> --
> <!-Outsider//->
> MS-DOS 6.22, Windows for Workgroups 3.11, Netscape Navigator 4.08
> MS-DOS 7.1, Windows 4.1 (a.k.a. 98), Netscape Navigator 4.74

MS-DOS is off-topic in this NG :->

--
__ _ _
|_ |_)(__ http://www.fpschultze.de
___| | ____)chultze_________________________________________________
I am logged in, therefore I am.

Outsider

unread,
Mar 24, 2001, 7:53:54 AM3/24/01
to
Frank-Peter Schultze wrote:
>
> "Outsider" <nonvali...@yahoo.com> schrieb im Newsbeitrag
> news:3ABB6043...@yahoo.com...
> > Rick Charnes wrote:
> > >
> > > Thanks very much; where do you find such information?
> >
> > No secret. This information is part of DOS 6.x help files that
> > ship(ped) with MS-DOS.
> >
> > More:
>
> [Useful bookmarks snipped]
>
>
> MS-DOS is off-topic in this NG :->

<LOL>

My sig must also be highly illegal!

0 new messages