Solved

Script to disable autorun for USB devices for Windows XP

Posted on 2009-03-31
13
3,145 Views
Last Modified: 2012-05-06
I need a script either VB or a batch file to disable autorun for USB devices for windows XP.  Your help is much appreciated.
0
Comment
Question by:ln733
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
  • 3
  • +2
13 Comments
 
LVL 6

Expert Comment

by:Justin_W_Chandler
ID: 24030138
USB devices don't use autorun :)
0
 
LVL 66

Expert Comment

by:johnb6767
ID: 24030214
USB Thumb Drives, cameras, phones w/ memory cards, ipods in "Disk Mode" certainly do use Autorun....

What USB devices are you referring to SPECIFICALLY?
0
 

Author Comment

by:ln733
ID: 24030656
I am looking to disable USB keys.  If possible.....I would like to still have ipod and memory card functionality.
0
[Live Webinar] The Cloud Skills Gap

As Cloud technologies come of age, business leaders grapple with the impact it has on their team's skills and the gap associated with the use of a cloud platform.

Join experts from 451 Research and Concerto Cloud Services on July 27th where we will examine fact and fiction.

 
LVL 6

Expert Comment

by:Justin_W_Chandler
ID: 24030839
nod@johnb6767 I assumed he was talking about thumbdrives (or whatever you want to call them). It turns out I may have been right... USB keys = thumbdrives?

ln733: Use Symantec Protection Agent
0
 

Author Comment

by:ln733
ID: 24030881
Has to be a script.  We unfortunately don't have the budget to implement a enterprise application to restrict users from using usb thumbdrives.
0
 
LVL 6

Expert Comment

by:Justin_W_Chandler
ID: 24030947
I'm afraid that if you allow ipod and memory card functionality, you're effectively negating the security benefit of disabling thumb drives... With that said, perhaps the most appropriate solution is also the easiest. Just remove the drivers associated with thumb drives.
0
 

Author Comment

by:ln733
ID: 24031000
Ok....We don't entirely want to disable the thumb drive.  We just want to turn off autorun.  All USB devises such as USB Thumbdrives, Ipods, and etc.  Except for CD and DVDs.

0
 
LVL 66

Expert Comment

by:johnb6767
ID: 24031003
Disable USB Disks with GPO
http://www.petri.co.il/disable_usb_disks_with_gpo.htm

HOWTO: Use Group Policy to disable USB, CD-ROM, Floppy Disk and LS ...
http://support.microsoft.com/kb/555324

Nothing needed to purchase..... If this cant be done by GPO in YOUR environment, then we can look at a .reg script to run in your logon script perhaps?
0
 
LVL 66

Expert Comment

by:johnb6767
ID: 24031038
Standby.....
0
 
LVL 66

Expert Comment

by:johnb6767
ID: 24031082
How to disable the Autorun functionality in Windows
http://support.microsoft.com/kb/967715/

See if this GPO method might help, if you have the appropriate HF installed.....
0
 
LVL 47

Accepted Solution

by:
Donald Stewart earned 500 total points
ID: 24032534
I like this best

Advanced Autorun / Autoplay settings ADM file

Use the adm below


; Advanced Autorun settings (AdvancedAutorun.adm)
; See http://support.microsoft.com/kb/953252 for details
 
CLASS MACHINE
 
CATEGORY !!AdvancedAutorun
	POLICY !!AutorunAdvanced
		KEYNAME "Software\Microsoft\Windows\CurrentVersion\Policies\Explorer"
 
		PART !!Autorun_Box          DROPDOWNLIST REQUIRED
			VALUENAME "NoDriveTypeAutorun"
			ITEMLIST
				NAME !!Autorun_Default		VALUE NUMERIC 145 ; 0x91
				NAME !!Autorun_NoRemovable	VALUE NUMERIC 149 ; 0x95
				NAME !!Autorun_NoFixed		VALUE NUMERIC 153 ; 0x99
				NAME !!Autorun_NoRemovableFixed	VALUE NUMERIC 157 ; 0x9D
				NAME !!Autorun_NoCD		VALUE NUMERIC 177 ; 0xB1
				NAME !!Autorun_NoRemovableCD 	VALUE NUMERIC 181 ; 0xB5
				NAME !!Autorun_NoFixedCD	VALUE NUMERIC 185 ; 0xB9
				NAME !!Autorun_None		VALUE NUMERIC 255 DEFAULT ; 0xFF
			END ITEMLIST
		END PART
		PART !!Autorun_Text1	TEXT
		END PART
		PART !!Autorun_Text2	TEXT
		END PART
	END POLICY
END CATEGORY
 
CLASS USER
 
CATEGORY !!AdvancedAutorun
	POLICY !!AutorunAdvanced
		KEYNAME "Software\Microsoft\Windows\CurrentVersion\Policies\Explorer"
 
		PART !!Autorun_Box          DROPDOWNLIST REQUIRED
			VALUENAME "NoDriveTypeAutorun"
			ITEMLIST
				NAME !!Autorun_Default		VALUE NUMERIC 145 ; 0x91
				NAME !!Autorun_NoRemovable	VALUE NUMERIC 149 ; 0x95
				NAME !!Autorun_NoFixed		VALUE NUMERIC 153 ; 0x99
				NAME !!Autorun_NoRemovableFixed	VALUE NUMERIC 157 ; 0x9D
				NAME !!Autorun_NoCD		VALUE NUMERIC 177 ; 0xB1
				NAME !!Autorun_NoRemovableCD 	VALUE NUMERIC 181 ; 0xB5
				NAME !!Autorun_NoFixedCD	VALUE NUMERIC 185 ; 0xB9
				NAME !!Autorun_None		VALUE NUMERIC 255 DEFAULT ; 0xFF
			END ITEMLIST
		END PART
		PART !!Autorun_Text1	TEXT
		END PART
		PART !!Autorun_Text2	TEXT
		END PART
	END POLICY
END CATEGORY
 
[strings]
AdvancedAutorun="Advanced Autorun Settings"
Autorun_Box="Turn off Autoplay on:"
Autorun_Default="No drives (XP/Vista default)"
Autorun_NoRemovable="Removable drives"
Autorun_NoFixed="Fixed drives"
Autorun_NoRemovableFixed="Removable, Fixed drives"
Autorun_NoCD="CD-ROM drives"
Autorun_NoRemovableCD="CD-ROM, Removable drives"
Autorun_NoFixedCD="CD-ROM, Fixed drives"
Autorun_None="All drives (including RAM drives)"
AutorunAdvanced="Turn off Autoplay (advanced)"
Autorun_Text1="Windows XP and Vista disable Network and Unknown drives by default"
Autorun_Text2="Windows 2000 and Server 2K3 also disable Removable drives by default"

Open in new window

0
 
LVL 2

Expert Comment

by:esa_esa_2000
ID: 24554794
Use this vaccine from Panda security , it is free to use it will protect your usb device from beeing infected  by putting its autorun files by way it will be unoverwritable by viruses will keeping windows autorun function working as before asking you what you want when you insert your usb device
i tried it surely i can but my usb stick in infected computers my usb never infected by autorun
by the way  usb autorun vireses have 2 components
1- the virus itself
2-autorun file executed by windows(this wat will be vaccined) used by virus maker to load the virus(1) into your PC
0
 
LVL 47

Expert Comment

by:Donald Stewart
ID: 24555858
What????
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If like me you are one who spends a lot of time working and scripting with cmd.exe, sometimes it is handy to be able to quickly view a calendar for a given month and year. This script will quickly do just that!  Save the code posted below to a .bat …
You may have already been in the need to update a whole folder stucture using a script. Robocopy does it well and even provides a list of non-updated files in a log (if asked to). Generally those files that were locked by a user or a process by the …
Windows 8 comes with a dramatically different user interface known as Metro. Notably missing from the new interface is a Start button and Start Menu. Many users do not like it, much preferring the interface of earlier versions — Windows 7, Windows X…
With the advent of Windows 10, Microsoft is pushing a Get Windows 10 icon into the notification area (system tray) of qualifying computers. There are many reasons for wanting to remove this icon. This two-part Experts Exchange video Micro Tutorial s…

617 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question