473,609 Members | 1,861 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Resetting the USB bus

I am trying to Reset the USB bus.

I have a system with various USB devices attached to it including video
capture devices. Occasionally some of the USB devices either disappear or
fail to operate. Restarting the computer or unplugging and replugging the
device corrects this, however this is not a viable solution while the system
is running.

I'm looking for a way of resetting or re-initializing the USB bus or the USB
hub in the hope that this will reset the device. I can detect when the device
is not present in the software and therefore when to attempt to reset the
device or USB bus.

I tried the following code (in C#) to reset the USB line, but it throws an
exception:
public static void ListUSB()
{
System.Manageme nt.ObjectQuery objectQuery =
//new System.Manageme nt.ObjectQuery( "select * from CIM_USBControll er");
new System.Manageme nt.ObjectQuery( "select * from CIM_USBHub");

// search and get the list
System.Manageme nt.ManagementOb jectSearcher searcher = new
System.Manageme nt.ManagementOb jectSearcher(ob jectQuery);
System.Manageme nt.ManagementOb jectCollection list = searcher.Get();

// step through the list of devices
foreach (System.Managem ent.ManagementO bject item in list)
{
item.InvokeMeth od("Reset", null);
}
}
I have tried this with the CIM_USBHub and CIM_USBControll er classes.

Can anyone help or does anyone know how to do this?

Thanks
--
Richard
Jan 18 '06 #1
1 2375
Hi Richard,

There are several replies to your questions in wmi and kernel newsgroup,
please follow up there. Thanks

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights
Jan 19 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
2261
by: The Plankmeister | last post by:
Hi... I'm getting to grips with custom error handling, and am wondering if it is possible to somehow reset all the content already sent to the browser, and send some new stuff in its place. For example, if I'm looping through a database, and I've already written 10 records to the browser, and then an error occurs, is it possible to send a command to the browser that makes it drop everything it's received thus far, and then just have...
8
18749
by: riprod | last post by:
Someone in the IIS newsgroup suggest I post this here, so sorry in advance for the cross posting. I have a Win 2003 SP1 with IIS 6 and host about 40 websites, most of them useing ASP/VB with access databases. The server is a Dell Dual 2.4Ghz XEON with 512Mb Ram. Every few days I get the error 'HTTP/1.1 New Session Failed' and the server stops showing the sites. It comes right after a bit and then the error comes back. I
1
1711
by: Frantic3d | last post by:
I just started using Access' Template file "Time & Billing Database" Well among other items I need to change the biggest right now is resetting the Client, Employee, Project ID #'s to start at 1. Is there a simple fix for this? TIA Neil
2
1808
by: DeveloperPDX | last post by:
I am creating a page and I need to add a reset button (like you would with HTML forms). Is there any way to do this other than resetting individual controls? Basically I need to page to return to the state after the OnLoad event
1
3082
by: Matthew Wieder | last post by:
Hi - I wanted to capture the enter button on a form since I have a datagrid with the first column being a delete button and if someone hits enter it deletes the first record. I coded: private void Page_Load(object sender, System.EventArgs e) { Page.RegisterHiddenField("__EVENTTARGET","SomeButtonOnThePage");
3
1753
by: No One | last post by:
This seems to be related to the ViewState error that is now starting to plague ASP.Net apps. When the Application Pool is recycled, the Session seems to be getting reset. When this is done, session information is lost and my app forgets what rules a user has. I'd rather not recode to read this from the database for every page, but I wonder if I have no other choice. Anyone else notice the Session resetting?
0
1041
by: Padma | last post by:
Hi, I'm working in Visual Studio 2005. I created a simple add-in and installed it. It got added to the 'Tools' menu in the IDE and '.addin file' got copied to '..\My Documents\Visual Studio 2005\Addins'. And the addin works well. When i reset the IDE by 'devenv /resetsettings', addin got removed from the 'Tools' menu. and I need to drag it from the 'Addins' list in 'Tools\Customize..' to 'Tools' menu.
4
4072
by: Ian Davies | last post by:
Hello I am struggling for a solution to clear some fields on my webpage that takes their values from some sessions My solution below works when the button is clicked twice. I sort of know why I have to click it twice to do the job (the first submit resets the sessions but this it too late to change the field values, which requires another submit to pick up the new session values). Problem is I cant think how to accomplish the resetting of...
8
2871
by: Kevin | last post by:
I'm using a form where users can input a bunch of info into unbound text controls that are used in series of calculations. At the bottom is a "reset" button. I want to clear out all of the user inputs on the form by clicking the button. Me.Refresh .requery .repaint do not work. Any suggestions?
0
8130
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8076
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8541
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8222
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8406
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5510
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4021
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4085
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2531
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.