Are you sure prompt from DEL command

If I issue a DEL /S command then I get prompted to confirm the action, something like:
Code:
G:\Daily_backups_test>del /s 2012-03-31\
G:\Daily_backups_test\2012-03-31\* : Are you sure (Y/N)?
but if I redirect the standard output from the command (say to a file) then:
Code:
G:\Daily_backups_test>del /s 2012-03-31\ >>test_del.log
Are you sure (Y/N)?
as you can see, the part of the prompt after the colon still comes out on the console but the rest of it does not and instead appears in the redirected output, making it quite difficult to work out what is going on in certain contexts (in my case, a batch routine that is iterating over subdirectories based on their last update date). Is the split destination of the two elements deliberate?? May I request that it be changed so that both elements are written to the console when standard output is redirected??
 

rconn

Administrator
Staff member
May 14, 2008
12,356
150
This is a feature -- if output is redirected, the prompt is written directly to the console. (Otherwise, you'd be sitting there looking at a blank line and not knowing why TCC stopped working.) And if the filenames were displayed to the console, you couldn't redirect them.

If you want to both see the filenames and redirect them, and also get a visible prompt, use TEE.
 
This is a feature -- if output is redirected, the prompt is written directly to the console
Okay, I understand the logic of what you're doing but I still think that an 'are you sure' prompt on its own is confusing. Would it not be possible to write the filename to both the redirected location and the console in this particular instance??
 

rconn

Administrator
Staff member
May 14, 2008
12,356
150
Not really, because the output is coming from radically different places. It would require a (substantial) rewrite of DEL. And then people would want it everywhere else that you could be mistakenly using the prompt switch while redirecting (COPY, MOVE, REN, etc.), so I'd have to rewrite all of those commands too.
 
Similar threads
Thread starter Title Forum Replies Date
T Error: This page can’t be displayed Make sure the web address //ieframe.dll/dnserrordiagoff.htm# is correct. Support 8
D del /s /q /f asks Are you sure (Y/N)? Support 7
M @Files sure doesn't work the way I would have assumed it did! Support 4
C not sure of windows registry function use Support 2
M “Reawakeng" of an old issue with the "copy" command that I'm not sure I've ever reported in the past Support 6
vefatica ANSI, PROMPT ... ??? Support 1
FreezerBurnt ANSI Prompt messes up list output. Support 39
FreezerBurnt "Missing SETLOCAL" when initializing Visual Studio Command Prompt. Support 9
M How to? Black TCC Prompt Support 2
N Command execution slows down in TCC Prompt after a while Support 6
K Fixed Prompt display will be shifted after use dir to display a filename with Chinese. (v25.00.28 x64) Support 18
vefatica Timing commands with $= in the prompt? Support 16
samintz How to? Alias or prompt? Support 1
T Elapsed time format in prompt changed in TCC 25 Support 10
samintz MOVE and Prompt on overwrite Support 3
robinsiebler Creating a custom prompt Support 9
K TCC prompt background color Support 4
Alpengreis Problem if command prompt is not legacy Support 4
Joe Caverly Documentation Customizing the TCC Prompt Support 0
C How to? handle the UAC prompt on computer restarts with Everything Support 3
B when doing SFTP via IFTP to my secure site my users always get the finger print key prompt Support 1
M PROMPT with git branch Support 1
MikeBaas How to? SELECT: exclude files / display prompt Support 2
vefatica ? "prompt" command Support 3
S Elapsed time in TCC prompt question Support 0
Joe Caverly Determine if program started from command prompt Support 2
W Opening a new tab takes forever to get the command prompt Support 5
vefatica UAC prompt? Support 0
C How to? ctrl-c does not prompt "Terminate batch job" Support 2
Mordachai TCMD Prompt Here?!@ Support 14
vefatica Fixed DO, OSD, and cancel batch prompt Support 3
CWBillow Send Command-line with prompt? Support 6
David McClelland Why the prompt to del c:\* Support 7
S WAD BDEBUGGER command changes window title to "TCC Prompt" Support 4
S WAD Invoking BDEBUGGER changes window title to "TCC Prompt" Support 7
vefatica Cancel batch prompt? Support 0
1 CMD file kicks out to prompt Support 18
Exolon Strange Prompt. Support 6
JohnQSmith TC 13 - Prompt Support 2
S TITLEPROMPT - width x height in prompt? Support 14
T Wrong prompt in Windows command console Support 3
S 4NT - delete from command prompt and recycle bin Support 12
vefatica @@key aliases cause new prompt? Support 16
H Another multiple FTP password prompt issue Support 2
H Double prompt for password with * in FTP syntax Support 3
CWBillow TCMD prompt here only opens to root Support 6
D setting days back at prompt Support 12
M TCC Prompt Here Colors Support 0
Phileosophos Using a percent sign in the PROMPT Support 3
Charles Dye INPUT prompt oddity Support 5

Similar threads