Forum     

Go Back   Digit Technology Discussion Forum > Community > Tutorials
Register FAQ Calendar Mark Forums Read

Tutorials This section offers tutorials and How to's on just about anything related to computers and IT. Note: All tutorials are courtesy the posters and not verified by Digit


Closed Thread
 
LinkBack (1) Thread Tools Display Modes
Old 15-11-2007, 05:00 PM   1 links from elsewhere to this Post. Click to view. #1 (permalink)
Right Off the Assembly Line
 
Join Date: Nov 2007
Posts: 8
Default How to disable USB Drives (jump/flash/external/etc.)


This explains how to disable ONLY USB storage devices (flash/Jump/external HD's) completely without disabling keyboards, mice, etc.
This method completely stops USB drives without purchasing third party software.
1. Run regedit and navigate to HKLM\system\currentcontrolset\services\USBstor.
2. Change the value of the dword "Start" from 3 to 4. If the dword "Start" doesn’t exist, create it. This will prevent a previously installed USB device from loading when the device is plugged into the machine. ((As most of you know this a Microsoft suggestion, which does work perfectly at disabling previously installed devices, however, this alone will not disable USB storage completely. If a user plugs a new USB storage device into the machine the device will install and the dword value will be reset to 3. Now if you incorporate adding this into a script it alone will disable USB drives, but only after a user plugs a device in, removes it without uninstalling it, logs off then logs back on, thereby running the script. This means that there is a window of opportunity for users to have access to new devices, this may be acceptable for some, but not for others.))
3. The next thing to do is to change the permissions on the USBSTOR key. You need to DENY full control on the "system" group.
((What this does is denies everyone the ability to access the USBStor key, effectively killing the ability for any user (including admins) to install USB storage devices. Now the reason you deny the "system" group is because windows will use this account if no one is logged onto the machine yet. If say you want to deny a group of users called "staff", you would need to deny them using GP or a logon script. This will work great, but, if a "staff" group user plugs a USB drive in before logging in to Windows the device will be installed using in the background using the "system" group, then when the user logs in the "staff" group policy is applied denying the user access to the USBstor key, but by this point it makes no difference because the devices is already installed and accessible and once a device is installed the usbstor key is no longer used.))
So now that these two steps are done, *NO ONE* will be able to install USB drives.
If a user tries to use a previously installed drive the device will be blocked and nothing will happen, no prompts, nothing. This is accomplished through step 1, the dword value.
What happens if a user plugs in a "New" device that was not previously installed, the hardware wizard will run, asking for the location of drivers. Regardless of whether a user selects the "automatically" search and install or if they attempt to manually install 3rd party drivers, the HW wizard will prompt the user that "access is denied" once the drivers are selected. This is the result of step 2, denying "system".
Now that we know how to disable USB storage devices we need to find an efficient way to do this without driving through the registry on each and every machine.
This is what we can also to accomplish this method of killing USB drives quickly and easily.

Create 2 batch files, 1 batch to disable and another for administrators (tech support, ie.) that will re-enable USB drives if the need arises.

1: First thing is to get a copy of the tool "subinacl.exe". This tool is included with MS Server 2003 RK.

((What subinacl allows you to due is set specific permissions on the exact group or user, etc.. that you need to, this includes permissions on registry Keys which is what we will be doing.))

2: Once you have a copy of "subinacl.exe" set up a folder for your batch files. In my particular case I wanted these batch files available on the network so I created a shared folder named "DisableUSB" on a server. Next I created a subfolder within "DisableUSB" called "subinacl". Put a copy of "subinacl.exe" in this folder.


3. Next thing to do is create 2 “reg” files in the subfolder “subinacl”. I named the 2 files “dword3.reg” and “dword4.reg”. These files are going to be used to change the value of the dword “start” in the registry key Usbstor.

I assume most probably know how do create reg files, this is what should be in the files:

For “dword3.reg”
******
Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Servic es\USBSTOR]
"Start"=dword:00000003

*change the 3 to a 4 for “dword4.reg”*


4. Now put these 2 files in the “subinacl” folder if they weren’t created there.

OK, all the pieces should now be in place. For this example we have a shared folder (on no particular server) called “disableUSB”. Within this folder is a subfolder “subinacl” that has subinacl.exe, dword3.reg, and dword4.reg within it.

5 . Now to create the 2 batch files. I created these 2 files under the main share folder (disableUSB). One is called “disableUSBdrives.bat” which, you guessed it, disables drives, and the other for re-enabling drives, “enableUSBdrives.bat”. Wow…

This is how disableUSBdrives.bat is set up:

@echo off
cls
regedit /s \\servername\disableUSB\Subinacl\dword4.reg
\\servername\DisableUSB\Subinacl\subinacl.exe /keyreg \system\currentcontrolset\services\usbstor /deny=system
pause
cls
echo.
echo **USB drives disabled**
echo.
Pause

*the path will differ of course. \\servername is just an example.

for “enableUSBdrives.bat” simply change change “dword4.reg” to “dword3.reg” AND “deny=system” to “grant=system”

Notice that the only real meat to these batch’s is running regedit and running subinacl. Everything else (cls,pause,echo) is optional, for my particular situation it was needed.

6. Go the machines that you want to disable USB drives on and run the disableUSBdrives batch from the network share.

And that’s it. USB drives gone.

Now of course running a batch from each machine is still time consuming, but In my particular situation it had to be done this way, and is obviously much faster than driving through the registry.

The most efficient way to incorporate this would be with logon scripting. Unlike with just using the dword start=4 trick, after this script is run, there is no way for joe blow user to use any of his nifty little Jumpdrives or his hot new hard drives.

Also note that folder names and locations can be set up in any way and anywhere as long as the batch files point to the right place.

Regards
Dinesh
http://Knowurtech.com
(Good technical articles. Submit your articles and get featured on our website. Send email to
articles@knowurtech.com. To know the benefits http://www.knowurtech.com/be_an_expert.html

Source

Last edited by Asfaq; 19-11-2007 at 12:16 PM.
dinesh_ymca is offline  
Advertisements. Register and be a member of the community to get rid of them.
Advertisement

Old 18-11-2007, 02:04 AM   #2 (permalink)
In The Zone
 
Join Date: May 2004
Location: aapnu ahmedabad...
Posts: 205
Default Re: How to disable USB Drives (jump/flash/external/etc.)

great article...i wish i had read this 2 months back.....i had to figure all this out myself after serching google.....didnt find a place that had all the info in such concise manner...
actually usb is blocked in my company also...in my case apart from the above i also have to change security permissions in c:\windows\inf folder in order to enable usb drives....this is so as to allow the current user to access usbstor.inf (the driver for usb mass storage devices)...
welli do have a question though....in our workstations, if i change the registry value and permission of usbstor to enable usb, i'm able to enable usb...but after a few hours it get changed automatically to the original disabled state. (i dont restart the computer...but i do lock the desktop quite often)....any ideas y this is happening.?

good article anyway..
manmay is offline  
Old 18-11-2007, 02:16 AM   #3 (permalink)
Rubik's Uncle!!
 
Charan's Avatar
 
Join Date: Sep 2004
Location: ಬೆಂಗಳೂರು (Bengaluru)
Posts: 3,791
Default Re: How to disable USB Drives (jump/flash/external/etc.)

good tutorial dinesh did you write it?
__________________
i5 2400 | DH67BL | G.Skill Ripjaw 4 GB | FSP SAGA II 500W | CM 430 Black Elite | MSI R6850 Cyclone PE/OC | XBox 360 Controller | 21.5" Samsung Sync Master 2233 | 4 Mbps @75GB FUP :)
Battlefield 3 Multiplayer Discussion | Battlefield 3 Low Latency Servers List
Charan is offline  
Old 18-11-2007, 02:46 AM   #4 (permalink)
Microsoft MVP
 
Vishal Gupta's Avatar
 
Join Date: Jul 2005
Location: AskVG.com
Posts: 5,173
Default Re: How to disable USB Drives (jump/flash/external/etc.)

Copied from here:

www.petri.co.il/forums/showthread.php?t=3299

Without giving any credits and source. Its limit of plagiarism. Even this dude has posted the same at his blog and advertising here:

http://www.knowurtech.com/windows/disabling_usb.html

I hope you'll face some legal action soon.
__________________
:arrow: http://www.AskVG.com/
Vishal Gupta is offline  
Old 19-11-2007, 03:26 AM   #5 (permalink)
Right Off the Assembly Line
 
Join Date: Nov 2007
Posts: 2
Default Re: How to disable USB Drives (jump/flash/external/etc.)



Oh, he will, don't worry. Thanks for the heads up!
danielp is offline  
Old 19-11-2007, 04:10 AM   #6 (permalink)
Human Spambot
 
Kiran.dks's Avatar
 
Join Date: Apr 2006
Location: Pune, India
Posts: 2,501
Default Re: How to disable USB Drives (jump/flash/external/etc.)

Crazy guys. Plagiarism is flooding internet now. But sad that no law exists (fool proof) to tackle this. Dinesh, You need to learn soon before things become worst for you.

Moderators: Please delete his blog links which he is using for advertising in wrong way. And retain the link which Vishal has given.

Reported.
__________________
Kiran Kumar R
Kiran.dks is offline  
Old 19-11-2007, 09:25 AM   #7 (permalink)
Right Off the Assembly Line
 
Join Date: Nov 2007
Posts: 8
Default Re: How to disable USB Drives (jump/flash/external/etc.)

HI Guys,
I was not aware that this article has been stolen from that site. The article was submitted by one of the user to my site. I have written a mail to author of that site to take this approval and if he doesnot grant his permission , i will be removing that article from my site.
Cheers!!
Dinesh
dinesh_ymca is offline  
Old 19-11-2007, 09:47 AM   #8 (permalink)
हॉर्न ओके प्लीज़
 
victor_rambo's Avatar
 
Join Date: Sep 2007
Posts: 1,493
Default Re: How to disable USB Drives (jump/flash/external/etc.)

btw are those Ebooks on Dinesh's site legal copies?
__________________
विक्टर रॅंबो - चाणकया प्रभावित व्यक्ति

गीक होना माँगता
victor_rambo is offline  
Old 19-11-2007, 10:01 AM   #9 (permalink)
Dreamweaver
 
Gigacore's Avatar
 
Join Date: Aug 2006
Location: Bangalore
Posts: 3,904
Default Re: How to disable USB Drives (jump/flash/external/etc.)

anyway, thanks for sharing
__________________
Today's noobs are tomorrow's geeks. Don't make fun of them.. encourage them. - Gigacore

Follow me on twitter.com/gigacore
Gigacore is offline  
Old 19-11-2007, 10:48 AM   #10 (permalink)
Alpha Geek Banned
 
bikdel's Avatar
 
Join Date: May 2007
Location: Dharan, Nepal
Posts: 579
Default Re: How to disable USB Drives (jump/flash/external/etc.)

well if i have to turn USB down.. i go straight to BIOS and disable it

drawback is : no other USB devices you have will work..

but most of the time its only flash drives that you use in usb
__________________
I'm not a GEEk, i still use Windows!
bikdel is offline  
Old 19-11-2007, 01:54 PM   #11 (permalink)
Microsoft MVP
 
Vishal Gupta's Avatar
 
Join Date: Jul 2005
Location: AskVG.com
Posts: 5,173
Default Re: How to disable USB Drives (jump/flash/external/etc.)

Quote:
Originally Posted by dinesh_ymca
HI Guys,
I was not aware that this article has been stolen from that site. The article was submitted by one of the user to my site. I have written a mail to author of that site to take this approval and if he doesnot grant his permission , i will be removing that article from my site.
Cheers!!
Dinesh
Even the article was posted by some one else at your site, you could provide his/her name as credits. But you didnt, so in both way its plagiarism.


And thnx to Asfaq for adding source link.
__________________
:arrow: http://www.AskVG.com/
Vishal Gupta is offline  
Old 19-11-2007, 02:47 PM   #12 (permalink)
Right Off the Assembly Line
 
Join Date: Nov 2007
Posts: 2
Default Re: How to disable USB Drives (jump/flash/external/etc.)

Quote:
Originally Posted by dinesh_ymca
HI Guys,
I was not aware that this article has been stolen from that site. The article was submitted by one of the user to my site. I have written a mail to author of that site to take this approval and if he doesnot grant his permission , i will be removing that article from my site.
Cheers!!
Dinesh
No, you do NOT have my permission, and you need to remove the article ASAP.

Next time, all you have to do is ask, and I assue you that I have yet to say no to anyone, all I ask in return is credit and a link to the original article. Is that hard to do?

As for this incident, you will NOT get my permission, and I will continue to monitor your site. Remove the articles ASAP.
danielp is offline  
Old 19-11-2007, 06:26 PM   #13 (permalink)
Right Off the Assembly Line
 
Join Date: Nov 2007
Posts: 8
Default Re: How to disable USB Drives (jump/flash/external/etc.)

Hi Daniel,
Even i donot like someone else work to be published without giving him the due credit. If you donot want to believe me. Thats your problem not mine. I have removed that article from my site.
cheers!!
Dinesh
dinesh_ymca is offline  
Closed Thread

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


LinkBacks (?)
LinkBack to this Thread: http://www.thinkdigit.com/forum/tutorials/73279-how-disable-usb-drives-jump-flash-external-etc.html
Posted By For Type Date
How to disable USB Drives (jump/flash/external/etc.) - Page 2 - Petri.co.il forums by Daniel Petri This thread Refback 23-06-2010 02:23 AM

Similar Threads
Thread Thread Starter Forum Replies Last Post
All About ReadyBoost - Compatible & Incompatible USB Flash Drives topgear Hardware Q&A 2 04-08-2007 01:33 PM
Vista's ReadyBoost flash drives lack significant boost techtronic Technology News 20 19-07-2007 01:45 PM
Readyboost incompatible flash drives workaround Arsenal_Gunners Tutorials 7 30-03-2007 11:19 PM
SanDisk rolls out flash hard drives for laptops s18000rpm Technology News 4 05-01-2007 03:17 PM

 
Latest Threads
- by Who
- by Krow
- by clmlbx
- by Tech&ME
- by icebags

Advertisement




All times are GMT +5.5. The time now is 09:08 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.

Search Engine Optimization by vBSEO 3.3.2