1.

Solve : if error occurss???

Answer»

Hello everyone ,

For example ;

echo %number%>>C:\users\user1\desktop\test.txt

Assume that there is no path like this above on computer and after running the program echo gives error how do i UNDERSTAND that echo has error and how do i avoid displaying the error that occured to the screen .

Thank you Putting 2>errorlog.txt will SEND error messages to a log, and using the ERRORLEVEL variable can tell you what type of error. Echo something 1>file 2>errorlog.txt
If %errorlevel% neq 0 echo ERROR OCCURRED& goto menuAdd "if %errorlevel% neq 0 goto menu" after the commands. %HOMEPATH%\DesktopQuote from: BC_Programmer on September 10, 2009, 07:55:06 PM

%HOMEPATH%\Desktop
HOMEPATH doesn't have a drive. Use %userprofile% homedrive and path together.
Don't replace the RED with the variables.

Try using this as the path.

"%userprofile%\Desktop\%nameset%.bat"


Discussion

No Comment Found