Jump to content
Sign in to follow this  

Ejecting a USB Stick

Recommended Posts


This is just a start, it is brute and im shure there is a more elegant way to do it but i put it up if someone need a simple way.

Run(@SystemDir & "\Rundll32.exe Shell32.dll Control_RunDLLA hotplug.dll, vbNormalFocus",@SystemDir)
WinWait("[CLASS:#32770; TITLE:Safely Remove Hardware]")
WinActivate("[CLASS:#32770; TITLE:Safely Remove Hardware]")
WinWait("[CLASS:#32770; TITLE:Stop a Hardware device]")
WinActivate("[CLASS:#32770; TITLE:Stop a Hardware device]")
WinWaitClose("[CLASS:#32770; TITLE:Stop a Hardware device]")

Hope it helps out :mellow:

USB EJ.au3

Edited by TheRevenger

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.