threaded
08-13-2005, 08:36 AM
basically, I need to somehow get the info that this dos command would normally return
for /F "tokens=3 delims=\:" %%d IN (reg query HKLM\SYSTEM\MountedDevices ^| FIND "\DosDevices\" ^| FIND /V "5C") DO IF EXIST "%%d:\System Volume Information" cacls "%%d:\System Volume Information" /E /G "Default User":F "Administrator":F
Basically, it finds all hard drives on the system, through the registry (need this method because when using a card reader, windows errors if it tries to search for a file on a disk that doesnt exist)...5C is the reg_binary code that all other "drive" devices that ARE NOT hard drives (hence the /V...that means without the string 5c). Since the drive has to be NTFS, an if exist is required to determine if its NTFS or FAT32...if its NTFS, cacls is run to allow Default User and Administrator to open the folder (since its normally locked).
So basically Im looking for a way to put this in AMS so I dont have to run that in a batch file. I have converted almost everything else to run from within AMS, but this one has me stumped because I dont know how to make it search for a string and return everything else that does not include the string.
Any help is greatly appreciated.
for /F "tokens=3 delims=\:" %%d IN (reg query HKLM\SYSTEM\MountedDevices ^| FIND "\DosDevices\" ^| FIND /V "5C") DO IF EXIST "%%d:\System Volume Information" cacls "%%d:\System Volume Information" /E /G "Default User":F "Administrator":F
Basically, it finds all hard drives on the system, through the registry (need this method because when using a card reader, windows errors if it tries to search for a file on a disk that doesnt exist)...5C is the reg_binary code that all other "drive" devices that ARE NOT hard drives (hence the /V...that means without the string 5c). Since the drive has to be NTFS, an if exist is required to determine if its NTFS or FAT32...if its NTFS, cacls is run to allow Default User and Administrator to open the folder (since its normally locked).
So basically Im looking for a way to put this in AMS so I dont have to run that in a batch file. I have converted almost everything else to run from within AMS, but this one has me stumped because I dont know how to make it search for a string and return everything else that does not include the string.
Any help is greatly appreciated.