Entry type: FAQ, Entry ID: 18796767, Entry date: 04/14/2004
(0)
Rate

Logging off USB sticks from the operating system

  • Entry
  • Associated product(s)

QUESTION:  
How can I remove a USB stick from my computer without having to disable it beforehand via the operating system?

ANSWER:  
In principle all device drivers have to be disabled before they are removed from the computer. This is done via the Windows function "Remove Hardware". If you have blocked access to the operating system through WinCC, then you won't have access to the above-mentioned Windows function.

In this entry we explain how to disable devices (e.g. a USB stick) using the MS application DevCon. The MS application and more information on DevCon is available on the Microsoft Support site, article number: 311272.

Example:

  1. Load the MS application DevCon from the Microsoft Support site (http://support.microsoft.com). Double-click the self-extracting file to unpack it in a folder of your choice (e.g. d:\Devcon).

  2. In this folder you create a batch processing file called "Devcon.bat".

  3. Edit "Devcon.bat" and insert the following lines:
    d:\devcon\devcon remove USB\VID* 
    exit

    Note:

    VID is the device name. If you want to disable all the USB devices, use"*".

  4. Create a button in a WinCC picture.

  5. Open the Properties of the button.

  6. Switch to the "Event" tab.

  7. Select "Mouse" and double-click on "Mouse Click".

  8. Insert the following code line into the script:
    ProgramExecute("d:\\devcon\\Devcon.bat");

  9. Close the Script editor.

  10. Save the picture.

  11. Now when you enable WinCC and press the button, the USB stick is logged off from the system. The requirement is that there is a USB stick is slotted.

Note:
Please also refer to Entry ID: 18796988 - "WindowsXP/2000 with WinCC V6.0 and USB Stick".

IMPORTANT
No warranty is ever given for third-party software. Use of the software is entirely at the users own risk.