how to include success or failure return codes in IF EXIST statemnt in batch script



Helloo All
Any ones help would be appriciated,
in the below code how should i include the return code for failure
and success so that the command if %errorlevel%
could identify
if exist "c:\test\file.ext" echo failure
move/y "C:\test\file.ext" "C:\quality\"
if not exist "c:\test\file.ext" echo success
if %errorlevel% NEQ 0 GOTO ERROR


move /y "C:\test\file.ext" "C:\quality\"
if %errorlevel% == 1 echo success
if %errorlevel% == 0 echo failure

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question