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:
- 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).
- In this folder you create a batch processing file called
"Devcon.bat".
- 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"*".
- Create a button in a WinCC picture.
- Open the Properties of the button.
- Switch to the "Event" tab.
- Select "Mouse" and double-click on "Mouse Click".
- Insert the following code line into the script:
ProgramExecute("d:\\devcon\\Devcon.bat");
- Close the Script editor.
- Save the picture.
- 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.
|