HackingOperating SystemTips and Hacks

6 ways to enable or disable USB ports-windows xp/7/8

So i’ve been looking for a while on just how to close a port on a computer. I simply couldn’t find a way. Well, i finally found it. This’ll only work for windows users. How frequently does your friends use your pendrive port? I believe many times in fact every time your friends try to use the USB port,due to whick your pc get infected by many viruses. Well, you don’t need to worryfurther because the solution to disable or enable USB Ports is pretty simple. Today in this post I’ll be listing 6 ways to enable or disable USB ports.



6 ways to enable or disable USB ports:

Methods Include:

  • Using NETSH command.
  • Using Microsoft Fix It.
  • Using third-party freeware
  • By Un-installing the USB Mass Storage Drivers
  • Disabling USB Ports from Device Manager (Recommended)
  • Altering registry values for USB Mass Storage Devices.

Method 1:Using NETSH command.

it’s actually quite simple. here’s the command for it:

netsh firewall delete portopening TCP portnumber it’s that simple. Simply go to START -> RUN -> and type in that command up there, and it’ll close it for you or  you can also open up command prompt (START -> RUN -> CMD) and type in “netsh”
without the quotes to get to your windows firewall settings. However, since i’m such a nice guy, i wrote it all out in a vbs script for you so that it’s automatically runable as well as a batch script. So here you are fellas:

.VBS Script

set ss = createobject(“wscript.shell”)set ws = wscript
dim PORT
PORT = InputBox(“Enter the port you wish to close:”)
ss.run “netsh.exe”
ws.sleep 1000
ss.sendkeys “firewall delete portopening TCP ” & PORT
ss.sendkeys “{enter}”
ws.sleep 500
‘ss.sendkeys “exit”
‘ss.sendkeys “{enter}”

.BAT Script

@echo off
title Port Closer
echo Port Closer
set /p port=Type the port number you wish to close here:
netsh firewall delete portopening TCP %port%
msg /w * Port %port% has been closed.

METHOD 2: Using Microsoft Fix It.

If a USB storage device is already installed on your Windows computer, you can edit the Widnows Registry to ensure sure that the USB does not work when anyone connects it to the PC, using this Microsoft Fix it 50061. Check first if it applies to your version of the Windows operating system.

METHOD 3: Using third-party freeware

You can download and use a free tool USB Drive Disabler / Enabler which will allow you to easily enable or disable USB drives on your Windows computer.

usb disabler How to enable or disable USB Drives or Ports in Windows 7 | 8

METHOD 4: By Un-installing the USB Mass Storage Drivers

If the authorities are really worried about security in the school they would take the extreme step of un-installing the USB Mass Storage Drivers. To make things work, just install the device drivers. Here is how you do it.

As when you plug-in your USB drive, Windows will check for drivers, if not found Windows will prompt you to install the driver. This would definitely unlock the Pen drive at your School or office.

METHOD 5: Disable USB Ports from Device Manager

If you still don’t find your USB drive working, you may have to look into the Device Manager. The Administrator could have possibly disabled the USB port here. Check out for any possibility in the Device Manager and enable the disabled port by right clicking on selected one and click Enable.

image2 How to enable or disable USB Drives or Ports in Windows 7 | 8

METHOD 6:Enable or Disable USB Drives and Mass Storage Devices using Registry

If the administrator is smart then he would definitely do this to ensure a tight blockade. He would alter the settings through regedit command on run console. Now how do you unlock it ? You have to go right into where the administrator has been. Here is how.

  1. Go to Start > Run , type “regedit” and press enter to open the registry editor
  2. Navigate to the following key


In the right pane, select Start and change the value to 3. (The value 4 will disable USB Storage). Click OK. This will re-enable USB Ports and allow you to use USB or Pen drives.

image1 How to enable or disable USB Drives or Ports in Windows 7 | 8


Also Read:



the authorHarinder
blacklisthackers.com is created and owned by Harinder(Aarav).Aarav is a technology Blogger from India(Dehradun). He’s Quiet type and Creative Guy who enjoys creating and exploring new trends on the WEB. Currently pursuing B.tech from DIT University.

Leave a Reply