The title may look like a n00bs question, but it isn't, I think.
I don't have any problems with that, I am working on a batch project, for the the last year and this recently accrued to me. My batch file has to write a log file to the directory that the batch file is in, and my program has trouble shooting of course. So I need my program to check is access is denied when writing that log file.
Now I have a small test batch file...
Code: Select all
echo Started program!>>batfile.txt
call :checklogUAC
:checklogUAC
if "%errorlevel%"=="0" exit /b
if "%errorlevel%"=="1" set "writeError=Writing log to file"
goto Errorwritefiles
Now the errorlevel check is not working for some reason. Currently I have made the log file read only so it will get the access is denied error, but the errorlevel check won't work.
Any ideas where I went wrong?
Thanks for your time
