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 __DATE__ and __TIME__ preprocessor commands?
The standard predefined macros are specified by the relevant language standards, so they are available with all compilers that implement those standards. Older compilers may not provide all of them. Their...
Subhasish
How can you avoid including a header more than once?
Use following in your header file. #ifndef "header_name" #define "header_name" /*header definition starts here*/ #endif /* header file ends here*/ Whenever you will include the same header file,...
Deepak
0 0
7
How can I write a C program to print a name without using a semicolon?
void main() { switch(printf("My name is john")) { } }
Anand
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

Everything about printf in C language
What is printf and from where it comes from in C code.? You must have used printf so many times in your Car programs but do you really know everything about printf? Let's see. What is the full form...

C Program-Temperature [conversion from farenheit to degree celsius]
//WAP to convert temperture from farenheit into degree celsius //Header files#include<stdio.h>#include<conio.h> //Main functrion void main(){ //Variable declaration of type float float...

Static and dynamic libraries
A library is a package of code that is meant to be reused by many programs. A static library (also known as an archive) consists of routines that are compiled and linked directly into your program. When...

Facts about C language
C programming language was developed in 1972 by Dennis Ritchie at AT&T Bell Labs. It was developed to overcome the problems of languages such as B, BPCL. It was developed to write the Unix operating...

PRACTISE makes you PERFECT ; ; ; There is no SUBSTITUTE for HARD WORK ;;;;Breathe SUCCESS like OXYGEN
Proper Planning ( reg what portions to be covered today) revising today's class portions & clarifying doubts solving Maths problems regularly ,noting down formulae separately trying to understand...

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