Is there a command to supress error messages in a batch script?
I have written a small script to delete a printer and want to use it as a logon script the only problem is that some of the computers dont have this printer and then gets prompted with an error message. Is there a way to suppress this. Thanks
Stdout comes out on ">" but stderr (your error messages) come out on "2>"
mycommand 2> nul
the above would just toss any errors (wouldn’t be visible).
you should be able to use the @ sign at beginnings of lines to suppress output.
Also
@echo off
should suppress all output thereafter from the script…
if that doesn’t work, just redirect the output to a file
echo "hello" > file.txt
or
errorcausingcommand > file.txt