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 does %d mean in the C programming language?
To specify the integer values in printf and scanf.
Vikas
0 0
6
Which language is best, C, C++, Python or Java?
If you want to learn any languages C#, Java, ect. then must to learn C, C++ language as these are base or language to be strong in language skills. C++ is improved version of C language. C#, Java, J# and etc. which are improved version of C++.
Sribaghya
0 0
6
Can anybody provide me error free coding for graphic program in C??? Animated Smiley program Rotating Fan progran Sunrise program
#include graphics.h #include conio.h #include stdlib.h #include dos.h main() { int gd = DETECT, gm,area,temp1,temp2,left =25,top=75; void *p; initgraph(&gd,&gm,”C:\TC\BGI”); setcolor(YELLOW); circle(50,100,25); setfillstyle(SOLID_FILL,YELLOW); floodfill(50,100,YELLOW); setcolor(BLACK); setfillstyle(SOLID_FILL,BLACK); fillellipse(44,85,2,6); fillellipse(56,85,2,6); ellipse(50,100.205,335,20,9); ellipse(50,100.205,335,20,10); ellipse(50,100.205,335,20,11); area...
Gayu
0 0
8
what is syntex error
In computer science, a syntax error ( not Syntex ) is an error in the syntax of a sequence of characters or tokens that is intended to be written in a particular programming language. For compiled languages,...
Tanha
In which program we use character constants?
For the name of months, animal, colors we do use it.
Mona

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

C Program-Infinite Loop[For] Demo
//Header Files #include<stdio.h>#include<conio.h> //Main function void main(){ //Function for clearing screen clrscr(); //Infinite for loop for(;;) { printf("Hello!"); } //Function for...

What is a Programming Language
What is a Language? Language is a communication system of human. What is a programming Language? A programming Language is a formal constructed language design to communicate...

C Program to print Block Letter and Small Case Alphabets using C
/* WAP to print Block Letter and Small Case Alpahbets using C*/ //Hint:use ascii code(value) to print #include#include void main(){ int i; clrscr(); //Block Letters Alphabets printf("Block Letters Alphabets\n");...

C and C++ programming with memory level debugging
Understanding C and C++ programming by using memory level debugging. Step 1: Understand the Memory map of C executable Step 2: Start memory level debugging using popular IDE Step 3: Find the memory...

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