mkdir %input%
.............
....................
......................
following are the lines which use the input lines is there a way that i
can catch the mkdir errorcodes and then exit appropriately
for example
mkdir %input%
if not ERROLEVEL 0 then GOTO ERRORX
something like that ... how to get the error code that the mkdir
returns
any explanations
What error do you want to catch? A pre-existing folder?
if exist "%input%\" echo folder exists
that's for NTish windows, BTW.
For Win9x/ME, and not a network drive, use this instead
if exist "%input%\nul" echo folder exists
> i want to catch other errors for mkdir like invalid folder name and
> other things what are the error codes the command returns....
Work it out emperically.
At a command line in NTish windows enter these:
echo %errorlevel%
md "abc/|def"
echo %errorlevel%
Note, it helps to know what OS you are working with. DOS..Win9x/ME do not
return an ERRORLEVEL but NT/XP does. The following code should help.
IF EXIST %input%\nul GOTO skip
MKDIR %input%
IF NOT EXIST %input%\nul GOTO error
:skip
--
Todd Vargo
(Post questions to group only. Remove "z" to email personal messages)