home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   alt.msdos.batch.nt      Fun with Windows NT batch files      68,980 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 67,564 of 68,980   
   dr.j.r.stockton@gmail.com to Peter   
   Re: How to Test Whether a Drive Exists   
   07 Jun 20 02:13:10   
   
   On Saturday, 6 June 2020 20:13:42 UTC+1, Peter  wrote:   
   > Tell me if I'm on the right track.  Again, what I'm trying to determine is   
   whether an external USB drive is 1) not currently connected to the PC or 2) it   
   is connected but it's locked by Bitlocker.  Is the following a workable   
   approach?   
   >   
   > If I issue the command DIR R: and the drive is not connected it will return:   
   > "The system cannot find the path specified"   
   >   
   > If I issue the command DIR R: and the drive is connected but locked I will   
   get:   
   > "This drive is locked by Bitlocker"   
   >   
   > Is it possible for the batch file to see which of those two responses I get   
   to DIR R: and then act accordingly?  If so, how do I do that?   
      
   One way should be to use   
       DIR R: 2> ZIGGURAT.EGG   
   and then to test the content of that file with FIND for   
   "Bitlocker" and then test ERRORLEVEL.  After, of course,   
   considering whether that filename may already be in use.   
      
      
   --   
     (c) John Stockton, near London, UK.  Using Google Groups.           |   
    Mail: J.R.""""""""@physics.org - or as Reply-To, if any.             |   
      
   --- 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