Shareittips.com

Computer & IT Tips By Akash Padhiyar

Nov
20

C Program to Disable and Enable Usb Port

Posted by Akash Padhiyar 0 Comment

In this post I will show how to create C program that Disables/Enables the USB ports on the computer (PC).

Open Your C Compiler and Copy paste below code and compile it.

To Disable usb port

#include<stdio.h>

void main()
{

system(“reg add HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Services\\USBSTOR \/v Start \/t REG_DWORD \/d 4 \/f”);

}

To enable usb port

#include<stdio.h>

void main()

{

system(“reg add HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Services\\USBSTOR \/v Start \/t REG_DWORD \/d 3 \/f”);

}

Akash Padhiyar

I am Akash Padhiyar Founder of Shareittips.com,BCA MCA Tutor ,Running Web development compnay "AkashInfoTech".

More Posts - Website - Facebook

Share
Categories: Other Stuffs

Leave a Reply


Google Search

Popular Posts

Web Designer vs Web

This Infographic explain you what is role of Web Designer and ...

Download Bluestack Offline

Download BlueStack O

Download BlueStack Offline  BlueStack is software in which you can run ...

FireCMD user interface

Command Prompt (cmd.

Serious geeks spend a lot of time at the command ...

Sponsors