Forums before death by AOL, social media and spammers... "We can't have nice things"
|    alt.msdos.batch    |    Fun with MS-DOS batch files    |    42,547 messages    |
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
|    Message 41,771 of 42,547    |
|    Anton Shepelev to All    |
|    A failed output redirection does not set    |
|    11 Nov 19 16:42:09    |
   
   From: anton.txt@g{oogle}mail.com   
      
   Hello, all   
      
   I can't seem to intercept an error while writing to   
   a file at an invalid path:   
      
   @echo off   
   type a > C:\NOSUCHNDIR est.txt   
   IF ERRORLEVEL 1 goto ERROR   
   echo All is well.   
   goto END   
   :ERROR   
   echo Error detected.   
   :END   
      
   The script above writes:   
      
   The system cannot find the path specified.   
   All is well.   
      
   C:\NOSUCHNDIR does not exist. How can I test the   
   success of an output redirection?   
      
   --   
   () ascii ribbon campaign - against html e-mail   
   /\ http://preview.tinyurl.com/qcy6mjc [archived]   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   
|
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
(c) 1994, bbs@darkrealms.ca