Hello

I'm New User in this forum

I need to simple code in Vb.Net for Open / close USB Port (Windows 7) ...

I'm waiting replay

and Thanks you

PS : I do not know Good the English language

Recommended Answers

All 7 Replies

Thanks you
but...
I did not understand this code
do this in VB.Net 2008?
I cannot useing this code
pleas help me

U can Open Window Dialog By Shell

Shell("RunDll32.exe shell32.dll,Control_RunDLL hotplug.dll")

I'm trying to find the way without dialog
now i converting vb to vb.net

Copy This File into your folder
Devcon.exe From Microsoft
And Then use this code

Shell(Application.StartupPath & "\devcon.exe disable *USBSTOR*")

to Disable All USB Storage

Shell(Application.StartupPath & "\devcon.exe enable *USBSTOR*")[/

You can change *USBSTOR* to *CDROM To disable/enable all CDROM Drive or Anything Device ID
*usb\ROOT_HUB* ' I'm Not Sure About This But It Can Change all USB Port

pleas help Me

Sorry
You Need To Extract file first before you use the file
Extract file And Copy The Inner file /i386/Devcon.exe
file to your directory

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.