Page 1 of 1 1
Topic Options
#44595 - 2003-08-28 08:08 PM Shell command error level checking
dsulli99 Offline
Lurker

Registered: 2003-08-06
Posts: 4
Hello~

I wanted to know if anybody could tell me how to do errorlevel checking for a shell command. For example, I have the line:

Shell "%COMSPEC% /e:1024 /c XCOPY /E /I /F C:\TDS.UL Y:\"+$USERNAME+"\"+$MDATE+"-"+$TRANSNUM

and I would like to check if the XCOPY commany was executed without error. I appreciate any help anybody could give me. Thanks.

~Dan
_________________________
Best Regards, Dan Sullivan

Top
#44596 - 2003-08-28 08:37 PM Re: Shell command error level checking
Howard Bullock Offline
KiX Supporter
*****

Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
Check the value of @Error. See also @Serror.
_________________________
Home page: http://www.kixhelp.com/hb/

Top
#44597 - 2003-08-28 08:39 PM Re: Shell command error level checking
Howard Bullock Offline
KiX Supporter
*****

Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
I do not think there is any reason to %comspec% in this shell statement. Using it may cause @error not to receive the XCOPY return code.

See: http://www.kixtart.org/board/ultimatebb.php?ubb=get_topic;f=10;t=000054#000000

[ 28. August 2003, 20:42: Message edited by: Howard Bullock ]
_________________________
Home page: http://www.kixhelp.com/hb/

Top
#44598 - 2003-08-29 09:37 AM Re: Shell command error level checking
Richard H. Administrator Offline
Administrator
*****

Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
Depending on your OS you may also check the environment variable %ERRORLEVEL%
Top
Page 1 of 1 1


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
1 registered (Allen) and 1607 anonymous users online.
Newest Members
Viginette, ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder
17888 Registered Users

Generated in 0.068 seconds in which 0.047 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org