Jump to content

Suppress "Operation completed successfully" in batch files?


Recommended Posts

Hello,

I run a bunch of batch commands at the end of my Unattended DVD. Via '@echo off' I was able to hide the command prompt, however lots of commands still send s "Operation completed successfully". Is there a way to suppress those messages?

Reg.exe is one example, and it doesn't feature a switch to turn these messages off, so is there a global option to turn those messages off?

Thanks for your help,

mf_2

Link to comment
Share on other sites


They are all adding information to the registry via the REG ADD command aren't they?

If you were to use the syntax I again gave you here then you wouldn't need to ask this question!

Clue: last four characters

Link to comment
Share on other sites

Sorry, I never saw your last reply in that other topic because my problem was solved meaning I didn't visit that topic anymore.

Does the /f>Nul also work for copy commands? Whenever I copy a file, it shows me "Copied 1 file(s) successfully" or something like that. I'd liek to get rid of that too. "copy /?" didn't show anything useful, I only found a switch in there to skip the confirmation upon overwriting files.

Link to comment
Share on other sites

  • 10 months later...
Yes, the following:
Copy [source] [destination] >Nul
will suppress the echoing of 'copied n file(s) successfully'

OK so, is there much this doesn't work for?

Up to now it works for...

DEL

REG

Even though those command line programs do not show any support for >Nul

I guess its trial and error the same as always.

Link to comment
Share on other sites

Basically, in the windows command line, the > character sends the output of whatever you're running to whatever is to the right of the > character. So, if you were to do

echo test > text.txt

Then test.txt would say "test" inside. Nul happens to be special in that Nul is Nul - that is, it's not there. It's sort of like sending it to nowhere. So by sending the output to nowhere, there is no output. :)

Be warned that using > repalces the existing file if there is already one, so in the above example, if test.txt had content already, it would've been erased. >> appends the output to an existing file or creates a new one if none exists, and may be more suitable for some situations.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...