1.

Solve : "SYSERR" parameter?

Answer»

Anyone ever use the "SYSERR" parameter in their DOS batch FILE for checking the "return-code"?  If so, can you provide a snippet of the code? I am LOOKING for an aternative to "%ERRORLEVEL%.   Could not find any documentation on SYSERR except as a user written C function. Why do you need an alternative to ERRORLEVEL? What are you trying to do?

 8-)I cannot count on ERRORLEVEL becuase it fails to catch an fileErrorException such as "Un-successful file delete - access denied", and always returns a misleading zero condition code.

This error situation occurs when trying to delete a file which I don"t have access to; here's the code:
call C:\WINDOWS\SYSTEM32\CMD.EXE /c DEL D:\myFile01.txt
Nobody ever accused Microsoft of being consistent, especially with error CODES.

This might be helpful:

Code: [Select]if exist D:\myFile01.txt call C:\WINDOWS\SYSTEM32\CMD.EXE /c DEL D:\myFile01.txt

Quote

This error situation occurs when trying to delete a file which I don"t have access to;

Not sure what this means, but if you don't have access to the file, how do you expect to delete it?

 8-)I know this sounds silly; but the "access denied" error situation does occur when a batch cmd file is run for the first time in production, and someone has overlooked granting the APPROPRIATE access to the userAccount.

I"ll test the "If exist" clause, and see how it behaves in my .bat file.

 




Discussion

No Comment Found