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,480 of 68,980    |
|    ythen1234234@gmail.com to All    |
|    Re: How to find a drive letter ?    |
|    28 Jan 20 12:24:43    |
   
   Hi Youri   
   Here's an example to find a drive letter given its serial number:   
      
   set serial=78EFF2DC   
   for /f "tokens=1,2*" %%A in ('powershell.exe -noprofile -command   
   "&get-ciminstance Win32_LogicalDisk| Select-Object DeviceId,Volu   
   eSerialNumber|Format-Table -HideTableHeaders"') do if %%B == %serial% set   
   letter=%%A   
      
   To filter on the volume label instead of volume serial, replace    
   olumeSerialNumber with VolumeName.   
      
   --- 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