This year, I was given the privilege to install NComputing in the computer lab of St. Aloysious Senior Secondary School in Wakiso District. The school administration had recommended a shift from standalone computers to a centralized system that made lab maintenance cheaper and also drive electricity bills down.
Read also: NComputing vs Standalone PCs
A week later, I was informed by the school’s administration that the lab I had just setup was down. I found out that the system was heavily infected and all office programs couldn’t run. This, I later found out was caused by infected flash disks that the students brought in.
Read also: How to protect your computer without an antivirus
I advised the teacher in charge to block access to USB storage without telling them. In this article, I will share 2 methods you can use to disable the use of USB ports in your computer lab.
Method 1: Registry Editor
- Open ‘Run’
- Type ‘Regedit’
- Pres ‘Enter’

You will then get access to the Windows Registry Editor (Pictured)

Navigate (Double click) to
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\USBSTOR
In right side pane Double click on REG_DWORD Start, A pop up window appears.

Change its value to 4 to Disable the USB. Change its value to 3 to Enable the USB
Method 2: Using batch files
Many times, the previous method can be intimidating. Another way to achieve this task is by creating batch files using Notepad.
Copy/paste the following code to notepad
reg add HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\USBSTOR /v Start /t REG_DWORD /d 4 /f
Save your notepad file as BlockUSB.bat
For it to work, you need to run it as Administrator.
To create an unblock batch file, open notepad and paste the following code
reg add HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\USBSTOR /v Start /t REG_DWORD /d 3 /f
Save it as UnblockUSB.bat. Remember to run as administrator.
__________________________________
Stephen Dumba
E-zone School of Computing
0752 111 223 / 0772 111 223