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

In C/C++, when should you use the comma (,) operator instead of the semicolon (;) statement terminator?
int a=2; b=a; b=a+2; Instead of the above two statements we can write it as b=(a,a+2); The value of b is 4
Thimma
0 0
5
How do I learn C programming by videos or books?
BOOKS AND PRACTICE by far remain the best way for learning any language ....
Fgrefg
0 0
7
What are all the data types in C programming with their details?
In the C programming language, data types constitute the semantics and characteristics of storage of data elements. They are expressed in the language syntax in form of declarations for memory locations...
Ganga
0 0
6
What is "&" called in C language?
In the C programming language, the "&" symbol is called the "address-of" operator. It is used to obtain the memory address of a variable. When you use "&" followed by a variable name, it provides...
Soumya
0 0
5

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

Ask a Question

Related Lessons

C Program Sample Application
//Standard Library Functions(Header Files used) #include<stdio.h> #include <conio.h> //Main method int main() { // function for clearing screen clrscr(); // function to print the output...
S

4 Things Every Tech Startup Needs to Know About The Coaching Industry
Knowledge on any subject is widely available to those who wish to learn. However, just gathering knowledge from other people doesn’t guarantee results in business. Results come from applying what...

C PROGRAM FOR GENERATING SOUND
#include<stdio.h> #include<conio.h> #include<dos.h> void main() { sound(3000); // sound function have single parameter , this parameter we put integer value its generating...

V. Muthu Ganeshan

0 0
0

Pointers Concept
Every variable has a memory location and every memory location has its address defined which can be accessed using ampersand (&) operator, which denotes an address in memory. Consider the following...

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...

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