Richard, we have a unit that needs to be tested on the production line, prior to shipping to the customer. The unit must work with both USB 2 and USB 3 connections. I won't go into the reasons why we need to test both connections but we do. At present the operator must manually take the USB cable out of the USB 3 socket, and put it into the USB 2 socket, and vice versa, when requested to do so by the test script. This introduces room for error, as they might get confused, and also they might end up damaging the USB socket since they will do this many times each day.
So a better solution is to have a software controlled way to switch between USB 2 and USB 3 connections. Jochen's suggestion is a significant improvement on the current scheme.
Do not trust software emulation where you can easily use real hardware...
In most computer there are both USB2 and USB3 port, and it is very easy to get a expansion card for $5 if you happened to work with a PC without USB2...
Skipper: We'll fix it. Alex: Fix it? How you gonna fix this? Skipper: Grit, spit and a whole lotta duct tape.
You may use an "USB 3 sharing switch" (use that search term). They provide connection of an USB device to two or more computers but may be off course also used to connect to two ports of one computer. These usually have a key to switch the ports and may support auto detection.
If you don't want the operator to press the switch key, you may look for one that supports other switching methods. I found at least one that allows switching using a hotkey when connected to a Windows PC. Your test program might then simulate the hotkey activation.
If the switch has an auto detection it should be also possible to trigger that by disabling one of the PC USB ports. But I have done such with Linux only so far and don't know how to do that with Windows. Note that this method (like the one initially asked) requires administrative privileges.
I want to execute a windows command in my C++ program.
I know it can be done by adding system function.
I want to add the windows command to a specific drive. I have coded a program which will collect the specific drive and will store the value in a wchar_t store
so in order to go for that specific drive I used
system("store");//variable in which the disk like D:\ is stored
No that will try to execute a program/script called store. It is not clear what you mean by "add the windows command to a specific drive". Do you mean that you wish to add the drive letter to the command as a parameter, like:
I think I have not explained my problem briefly.here is the brief explanation of my problem
I want to find the attributes of the removable drive so, I need to get the string of the drive I've done everything and stored the string value in the "store" variable I mean the variable consists the drive location(D:\) so that I can execute another system function called attrib to find its attributes.