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  

11 Answers

Learn C Language

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 is void main () into main and what it does?

Void main () is the entry point for execution in C program. The void is a keyword that represents function will not return anything but a void value. Main is the name of the function and () represents...
Noreen
What is the difference between #include< > and #include" "
first one is used for predefined header files.. and second is used for user defined header files
Priya
1 0
6

What is C language?

It is a general purpose high level language used to make software for operating systems (kernel programms), game development, Embedded devices etc. It avoids the complexity of writing machine code and...
Shiva
Can a file other than a .h file be included with #include?
Yes. user defined header file ex:#include "nim.c"
Pankaj
0 0
7

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

Ask a Question

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