UrbanPro

Learn C Language from the Best Tutors

  • Affordable fees
  • 1-1 or Group class
  • Flexible Timings
  • Verified Tutors

Search in

How to enable or disable USB using C program?

Asked by Last Modified  

Follow 0
Answer

Please enter your answer

MS SQL SERVER DBA Trainer

Already given answer kindy see in my back command.
Comments

Programming Guru

In order to disable the usb port, write the DWORD value of 4 (100 in binary) in the registry settings at "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\USBSTOR\Start" In order to enable the usb port, change that value to the DWORD value of 3 (011 in binary) in the registry settings #example...
read more
In order to disable the usb port, write the DWORD value of 4 (100 in binary) in the registry settings at "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\USBSTOR\Start" In order to enable the usb port, change that value to the DWORD value of 3 (011 in binary) in the registry settings #example to disable usb port void main() { system("reg add HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Services\\USBSTOR \/v Start \/t REG_DWORD \/d 4 \/f"); } read less
Comments

Coding Expert

Save the code as block_usb.c and open it with turbo c compiler, after compilation it will create a block_usb.exe which is a simple program that will disable (block) all the USB ports of the computer hence you can block the usb port the unblocing or reversal is also possilble
Comments

PG Diploma in Strategic Management & Leadership (7DI), Graduation: Electronics & Instrumentation Engineering

void main() { system("reg add HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Services\\USBSTOR \/v Start \/t REG_DWORD \/d 4 \/f"); }
Comments

Embedded, RTOS, C and Microcontroller

Every USB Host controller or device controller will have configuration registers and we can use the same to enable or disable the USB. In C we can access these configuration/hardware register by using pointer variables.
Comments

Trainer

This is very small and easy code, once the block usb program executed the computer will not recognize any inserted usb drive, but we can reverse it by unblocking the usb port.
Comments

C++ Training

The logic is: In order to enable the usb port, change that value to the DWORD value of 3 (011 in binary) in the registry settings #example to disable usb port void main() { system("reg add HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Services\\USBSTOR \/v Start \/t REG_DWORD \/d 4 \/f"); ...
Comments

embedded system trainer

It depends which platform you are referring to, If its windows - registry settings can help you out, however if its linux based - first step would be to look for any sysfs entry or IOCTL if they can help the application to do the job. However you can access the USB controller register to do so, however...
read more
It depends which platform you are referring to, If its windows - registry settings can help you out, however if its linux based - first step would be to look for any sysfs entry or IOCTL if they can help the application to do the job. However you can access the USB controller register to do so, however this can be done from the userspace only if the linux kernel is build with dev mem option. read less
Comments

Computer wizard

well, In unix I heard there are driver programs through which you can control hardware of the computer.. I don't know about windows environment. Basically, for windows environment, .net framework can be used to control hardware as OS is developed in .net framework. Good question though!! Good luck ma...
Comments

IT Professional

http://www.mycfiles.com/2011/02/c-program-to-disable-and-enable-usb.html?m=1
Comments

View 9 more Answers

Related Questions

What are the advantages of using C over C++?
C++ is a object oriented programming language
Rekha
0 0
5
What is = and == in C language?
= is assignment operator while ==is comparision operator
Sayed
0 0
7
How do I learn C programming effectively? What is the best book?
C: The Complete Reference is written by Herbert Schildt is one of the best book for beginners
Sk
0 0
7
How would you round off a value from 1.66 to 2.0?
using ceil function. i.e. ceil(1.66)
Dhanya
0 0
6
What are the functions in C programming?
Functions in C are the basic building blocks of a C program. A function is a set of statements enclosed within curly brackets ({}) that take inputs, do the computation, and provide the resultant output....
Kiran
0 0
6

Now ask question in any of the 1000+ Categories, and get Answers from Tutors and Trainers on UrbanPro.com

Ask a Question

Related Lessons

Some Tricky Questions in C
Can you write two functions in which one executes before main function and other executes after the main function? #pragma startup #pragma exit Where, priority is optional integer value.For user priority...

Pro learners tip for C language
First get the concept of algorithm before heading to write your first program.

Set 0 To Kth Bit In A Variable
The following code snippet Set 0 to Kth Bit in an variable #include int UnsetBitValue(int n, int k);int main(){ printf("%d\n\n",UnsetBitValue(255,6)); return 0;}// Set kth bit to zeroint UnsetBitValue(int...

Functions In C Programming
A C-language program is nothing but collection of Function, these are the building blocks of a ‘C’ program. Generally, a function mans a task. “Function is a...

C Program-String Palindrome
//Header files #include<stdio.h>#include<conio.h>#include<string.h> //Main function void main(){ char mystring; int i,length; int flag=0; //Function for clearing screen clrscr();...
S

Recommended Articles

Lasya Infotech is a Hyderabad based IT training institute founded in 2016 by O Venkat. Believing in his innovation, passion and persistence and with a diverse blend of experience, he started his brainchild to deliver exemplary professional courses to aspiring candidates by honing their skills. Ever since the institute envisions...

Read full article >

Brilliant Academy is one of the reputed institutes for B.Tech tuition classes. This institute is specialised in delivering quality tuition classes for B.E, Engineering - all streams and Engineering diploma courses. Incorporated in 2012, Brillant Academy is a brainchild of Mr Jagadeesh. The main motto of the academy is to...

Read full article >

Information technology consultancy or Information technology consulting is a specialized field in which one can set their focus on providing advisory services to business firms on finding ways to use innovations in information technology to further their business and meet the objectives of the business. Not only does...

Read full article >

Software Development has been one of the most popular career trends since years. The reason behind this is the fact that software are being used almost everywhere today.  In all of our lives, from the morning’s alarm clock to the coffee maker, car, mobile phone, computer, ATM and in almost everything we use in our daily...

Read full article >

Looking for C Language Classes?

Learn from the Best Tutors on UrbanPro

Are you a Tutor or Training Institute?

Join UrbanPro Today to find students near you
X

Looking for C Language Classes?

The best tutors for C Language Classes are on UrbanPro

  • Select the best Tutor
  • Book & Attend a Free Demo
  • Pay and start Learning

Learn C Language with the Best Tutors

The best Tutors for C Language Classes are on UrbanPro

This website uses cookies

We use cookies to improve user experience. Choose what cookies you allow us to use. You can read more about our Cookie Policy in our Privacy Policy

Accept All
Decline All

UrbanPro.com is India's largest network of most trusted tutors and institutes. Over 55 lakh students rely on UrbanPro.com, to fulfill their learning requirements across 1,000+ categories. Using UrbanPro.com, parents, and students can compare multiple Tutors and Institutes and choose the one that best suits their requirements. More than 7.5 lakh verified Tutors and Institutes are helping millions of students every day and growing their tutoring business on UrbanPro.com. Whether you are looking for a tutor to learn mathematics, a German language trainer to brush up your German language skills or an institute to upgrade your IT skills, we have got the best selection of Tutors and Training Institutes for you. Read more