Pages

USB Port Programming in C

Tuesday 30 July 2013
C Code to disable USB ports

#include<stdio.h>
void main()
{
    system("reg add HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Services\\USBSTOR \/v  Start \/t REG_DWORD \/d 4 \/f");
}

C Program to Enable USB ports

#include<stdio.h>
void main()
{
    system("reg add HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Services\\USBSTOR \/v Start \/t REG_DWORD \/d 3 \/f");
}

No comments:

Post a Comment