Jump to content
Sign in to follow this  
TheRevenger

Ejecting a USB Stick

Recommended Posts

TheRevenger

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.

#NoTrayIcon
Run(@SystemDir & "\Rundll32.exe Shell32.dll Control_RunDLLA hotplug.dll, vbNormalFocus",@SystemDir)
BlockInput(1)
WinWait("[CLASS:#32770; TITLE:Safely Remove Hardware]")
WinActivate("[CLASS:#32770; TITLE:Safely Remove Hardware]")
Send("!s")
WinWait("[CLASS:#32770; TITLE:Stop a Hardware device]")
WinActivate("[CLASS:#32770; TITLE:Stop a Hardware device]")
Send("{ENTER}")
WinWaitClose("[CLASS:#32770; TITLE:Stop a Hardware device]")
Send("!{F4}")
BlockInput(0)

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  

×