- Jan 12, 2004
 
- 11,078
 
- 11
 
- 81
 
Due to a series of unfortunate events (work politics, I'm sure you guys can understand) I have to impliment am automated system that disables the mounting of USB thumb drives on several loaner machine during their start-up process.
The goods news is I have a working batch file that will do this.
The bad news is actually getting this batch file to run on a few machines before the user logs in.
Since I'm not a programmer of any sorts (I'm mostly a hardware guy), I only have experience with working in Basic--here is what I've come up with so far (hold laughter till the end please):
Once we throw an image on a machine, our level one tech guys run a batch file (migration.bat) that configures, installs and tweaks the machines for our network enviroment. In the batch file (Image_Config.bat) I plan to make a call to our existing USB_Disable.bat file.
That batch, USB_Disable.bat, is suppose to make a comment in the registry to run the last batch file (Perm_Off.bat) so that they're disabled every time the machine is booted up.
Image_Config.bat I have this in there:
"if %computername% == <computername> call c:\migration\SetACL\USB_Reg_Disable.bat"
USB_Reg_Disable.bat:
SET KEY=HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run
REG ADD %KEY% /V TITLE /D "USB Drives Disable" /f
REG ADD %KEY%\01 /VE /D "Disable USB Thumb Drives" /f
REG ADD %KEY%\01 /V 1 /D "c:\migration\SetACL\Perm_off.bat" /f
...the problem is that it's not working. I know "Perm_off.bat" works because I've tested it seperately.
Ok, please stop laughing at me now! Help?
For refference, there are 3 batch files:
migration.bat - Runs after an image is pushed.
USB_Reg_Disable.bat - Makes registry entries to make call to perm.bat
Perm_off.bat - disabled the use of USB thumb drives.
			
			The goods news is I have a working batch file that will do this.
The bad news is actually getting this batch file to run on a few machines before the user logs in.
Since I'm not a programmer of any sorts (I'm mostly a hardware guy), I only have experience with working in Basic--here is what I've come up with so far (hold laughter till the end please):
Once we throw an image on a machine, our level one tech guys run a batch file (migration.bat) that configures, installs and tweaks the machines for our network enviroment. In the batch file (Image_Config.bat) I plan to make a call to our existing USB_Disable.bat file.
That batch, USB_Disable.bat, is suppose to make a comment in the registry to run the last batch file (Perm_Off.bat) so that they're disabled every time the machine is booted up.
Image_Config.bat I have this in there:
"if %computername% == <computername> call c:\migration\SetACL\USB_Reg_Disable.bat"
USB_Reg_Disable.bat:
SET KEY=HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run
REG ADD %KEY% /V TITLE /D "USB Drives Disable" /f
REG ADD %KEY%\01 /VE /D "Disable USB Thumb Drives" /f
REG ADD %KEY%\01 /V 1 /D "c:\migration\SetACL\Perm_off.bat" /f
...the problem is that it's not working. I know "Perm_off.bat" works because I've tested it seperately.
Ok, please stop laughing at me now! Help?
For refference, there are 3 batch files:
migration.bat - Runs after an image is pushed.
USB_Reg_Disable.bat - Makes registry entries to make call to perm.bat
Perm_off.bat - disabled the use of USB thumb drives.
				
		
			