Solved

batch files to enable and disable usb port and cd

Posted on 2011-03-04
8
4,791 Views
Last Modified: 2016-09-03
Hiya,

Would it be possible to write a MS Dos batch file to enable/disable the usb port and/or CD drive.

Thanks
0
Comment
Question by:PipMic
8 Comments
 
LVL 6

Expert Comment

by:richardburwood
Comment Utility
MS DOS batch file, No... Your best approach to this would be to use WSH scripting to edit the local security policy settings do enable / disable access to the drives.

See:

http://technet.microsoft.com/en-us/library/ee156602.aspx - editing the registry

I don't know the exact registry items to create / edit to enable / disable the drives...
0
 
LVL 24

Expert Comment

by:lionelmm
Comment Utility
You say you would to enable and disable a USB port--do you mean a USB drive or the USB port itself? Is the CD drive you want to enable/disable a removable drive or a fixed internal rive?
0
 

Author Comment

by:PipMic
Comment Utility
Hi,

I meant disabling the use of a usb device. as regards the cd drive its a fixed internal drive.

Thanks
0
What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

 
LVL 7

Accepted Solution

by:
waleeda earned 125 total points
Comment Utility
for disable use the below script and batch file

1st File: Disable USB.bat

@echo off
cls
regedit /s 4.reg



subinacl.exe /keyreg \system\currentcontrolset\services\usbstor /deny=system
subinacl.exe /keyreg \system\currentcontrolset\services\usbstor /deny=Administrators

cls
echo.
echo **USB drives disabled**

echo.

2nd File: 4.reg

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\USBSTOR]
"Start"=dword:00000004

make sure that you added "subinacl.exe" in the same folder while you are applying this script
0
 

Author Closing Comment

by:PipMic
Comment Utility
Would have preferred some explanantion, but i suppose i didnt ask for it!!
0
 

Expert Comment

by:bryan vanderveen
Comment Utility
Lol that is really clear. When he says the steps, he starts out with what you need to name the files. You need to open a new text document for each one and past the script to the text document. After that click file and save as. Then use the title he gave u in the beginnings of the steps and select All Files then save. A file will appear, click on all the files u made.
1

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Suggested Solutions

#Citrix #POC #XenDesktop #vCenter #VMware #ESX
In this previous article (https://oddytee.wordpress.com/2016/05/05/provision-new-office-365-user-and-mailbox-from-exchange-hybrid-via-powershell/), we made basic license assignments to users in O365. When I say basic, the method is the simplest way …
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

762 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

Need Help in Real-Time?

Connect with top rated Experts

6 Experts available now in Live!

Get 1:1 Help Now