@echo off

set /p Pause=Before
>nul
set /p Pause=After

(@edit Before >nul there supposed to be sign, but it's not visible in post.)
What does this script do, is print "Before" wait till user presses enter, "Bleeps" and prints "After", after pressing enter application stops. But output is:

'' is not recognized as an internal or external command,
operable program or batch file.

I tried >nul and @echo off as you see. But it still appears. How to get rid of it?

Recommended Answers

Hello,

The you need to redirect the output somewhere else which it looks like you are trying to do. Here is a link to a page that cover it very well:
http://www.robvanderwoude.com/battech_redirection.php

Jump to Post

All 4 Replies

Hello,

Try this instead:

@echo off
REM start of batch file
echo BEFORE
REM wait for them to press a key
pause
echo AFTER

You will notice that the REM lines are not printed as they are remarks

I do know they're not printed. But the problem is, I need something executed but it prints output, which I don't want being output.

Well, error doesn't show up. Neither does CMD beep.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.19 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.