# EXPERIMENT 6 – USB WRITE PROTECTION AND DISABLING

## PART A – DISABLE USB USING REGISTRY EDITOR

1. Press Win + R.
2. Type regedit and press Enter.
3. Navigate to:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\USBSTOR

4. Double-click Start.
5. Set Value Data = 4.
6. Click OK.
7. Disconnect and reconnect USB.
8. Verify USB storage is disabled.

## RE-ENABLE USB

1. Open the same registry location.
2. Double-click Start.
3. Set Value Data = 3.
4. Click OK.
5. Reconnect USB and test.

## PART B – WRITE PROTECT USB USING REGISTRY

1. Open Registry Editor.
2. Navigate to:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control

3. Right-click Control → New → Key.
4. Name it StorageDevicePolicies.
5. Open the new key.
6. Right-click → New → DWORD (32-bit) Value.
7. Name it WriteProtect.
8. Double-click WriteProtect.
9. Set Value Data = 1.
10. Click OK.
11. Reconnect USB.
12. Test writing a file.

## REMOVE REGISTRY WRITE PROTECTION

1. Open StorageDevicePolicies.
2. Double-click WriteProtect.
3. Set Value Data = 0.
4. Click OK.
5. Reconnect USB and test writing.

## PART C – WRITE PROTECT USING DISKPART

1. Connect USB drive.
2. Open CMD as Administrator.
3. Execute:

diskpart

4. Display disks:

list disk

5. Identify USB using its storage capacity.
6. Select USB disk (example: Disk 1):

select disk 1

7. Verify selected disk:

detail disk

8. Enable write protection:

attributes disk set readonly

9. Verify:

attributes disk

10. Exit:

exit

11. Try copying a file to USB. Writing should be blocked.

## REMOVE DISKPART WRITE PROTECTION

Execute:

diskpart
list disk
select disk 1
detail disk
attributes disk clear readonly
exit

Reconnect USB and test writing.

IMPORTANT: Always verify the disk number before selecting it. Never select your Windows system disk.

## PART D – USING RATOOL

1. Download Ratool from a trusted source.
2. Run as Administrator.
3. Select Block USB Storage Devices.
4. Click Apply.
5. Test USB access.
6. Select Allow Read Only.
7. Click Apply.
8. Test reading and writing.
9. Select Allow Read & Write.
10. Click Apply.
11. Verify normal USB access.

## PART E – CROSS-REVERSAL TEST

1. Apply USB protection using Registry Editor.
2. Test writing.
3. Try reversing protection using DiskPart.
4. Test writing again.
5. Repeat with DiskPart protection and Registry reversal.
6. Record observations.
7. Restore all settings.

## PART F – APPLY TWO PROTECTIONS SIMULTANEOUSLY

1. Enable Registry WriteProtect = 1.
2. Apply DiskPart readonly protection.
3. Test USB writing.
4. Remove DiskPart protection using:

attributes disk clear readonly

5. Test writing again.
6. Set Registry WriteProtect = 0.
7. Reconnect USB.
8. Verify normal writing access.

## EXPERIMENT 6 – RESULT

Successfully disable USB storage devices and implement USB write protection using Registry Editor, DiskPart and Ratool. Compare individual and combined protection methods.