1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Are you sure prompt from DEL command

Discussion in 'Support' started by Steve Pitts, Apr 29, 2012.

  1. Steve Pitts

    Joined:
    Jul 7, 2008
    Messages:
    159
    Likes Received:
    0
    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??
     
  2. Steve Pitts

    Joined:
    Jul 7, 2008
    Messages:
    159
    Likes Received:
    0
    FWIW this nit still exists in v14.03.59 and since this post never received a response I am wondering whether or not it passed beneath the radar
     
  3. thorsten

    Joined:
    Aug 16, 2008
    Messages:
    124
    Likes Received:
    0
    I guess the prompt is on stderr and you're only redirecting stdout
     
  4. rconn

    rconn Administrator
    Staff Member

    Joined:
    May 14, 2008
    Messages:
    10,090
    Likes Received:
    85
    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.
     
  5. Steve Pitts

    Joined:
    Jul 7, 2008
    Messages:
    159
    Likes Received:
    0
    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??
     
  6. rconn

    rconn Administrator
    Staff Member

    Joined:
    May 14, 2008
    Messages:
    10,090
    Likes Received:
    85
    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.
     

Share This Page