chaos945
OSNN Senior Addict
- Joined
- 10 Feb 2003
- Messages
- 934
I'm trying to figure out the following. In the end I want the script to be detecting all mounted drives and running designated programs on them.
Where "5c ?" is a hex value and 5c is the first term, if that term is 5c then the drive is not mounted. If another term is there, then the drive is mounted. I figure if I query each possible drive from C-Z in this way I can then do something like:
And so on down through to Z.
Mounted Drive info is stored in "HKLM\SYSTEM\MountedDevices".
Anyone have suggestions on a better way I'd love to hear it.
/edit
I've come up with an alternative, instead of using the registry entry as a flag, I'll use the "Recycler" folder created on all drives.
Code:
IF "HKLM\SYSTEM\MountedDevices" /v "\DosDevices\C:"=="5c ?" set Cdrive=0
Code:
if "%Cdrive%"=="1" run program C: /switch
Mounted Drive info is stored in "HKLM\SYSTEM\MountedDevices".
Anyone have suggestions on a better way I'd love to hear it.
/edit
I've come up with an alternative, instead of using the registry entry as a flag, I'll use the "Recycler" folder created on all drives.