spudw2k Posted August 17, 2007 Share Posted August 17, 2007 (edited) Here's a script I made to eject ipods. user: Neoborn made a script that does this too, but his requires the use of DevEject.exe......Mine's standalone. Detects the ipod via WMI and Ejects it via a Shell Object. Check it out. expandcollapse popup$strDeviceID = "" $objWMIService = ObjGet("winmgmts:{impersonationLevel=impersonate}!\\localhost\root\cimv2") $colItems = $objWMIService.ExecQuery("Select DeviceID from Win32_DiskDrive Where (Caption like " & chr(34) & "%ipod%" & chr(34) & ")") For $objItem in $colItems $strDeviceID = $objItem.DeviceID ;DeviceID of the ipod Next If $strDeviceID = "" then Exit $strDeviceID = StringRight($strDeviceID,(StringLen($strDeviceID)-4)) ;Formating $colItems = $objWMIService.ExecQuery("Select * from Win32_DiskDriveToDiskPartition") For $objItem in $colItems If StringInStr($objItem.Antecedent,$strDeviceID) <> 0 then $strPartition = $objItem.Dependent ;Partion Map EndIf Next $colItems = $objWMIService.ExecQuery("Select * from Win32_LogicalDiskToPartition") For $objItem in $colItems If StringInStr($objItem.Antecedent,$strPartition) <> 0 then $strLogicalDrive = $objItem.Dependent ;Logical Drive Letter EndIf Next $strDriveLetter = StringRight($strLogicalDrive,3) ;Formatting $strDriveLetter = StringLeft($strDriveLetter,2) ;Formatting $shell = ObjCreate("Shell.Application") $objDrives = $Shell.NameSpace(17) For $objDrive in $objDrives.Items If StringInstr($objDrive.Name,$strDriveLetter) <> 0 Then $objDriveItem = $objDrive EndIf Next if not isobj($objDriveItem) then Exit For $verb in $objDriveItem.verbs if $verb.Name = "E&ject" Then $verb.doit Next Edited March 12, 2008 by spudw2k Spoiler Things I've Made: Always On Top Tool ◊ AU History ◊ Deck of Cards ◊ HideIt ◊ ICU ◊ Icon Freezer ◊ Ipod Ejector ◊ Junos Configuration Explorer ◊ Link Downloader ◊ MD5 Folder Enumerator ◊ PassGen ◊ Ping Tool ◊ Quick NIC ◊ Read OCR ◊ RemoteIT ◊ SchTasksGui ◊ SpyCam ◊ System Scan Report Tool ◊ System UpTime ◊ Transparency Machine ◊ VMWare ESX Builder Misc Code Snippets: ADODB Example ◊ CheckHover ◊ Detect SafeMode ◊ DynEnumArray ◊ GetNetStatData ◊ HashArray ◊ IsBetweenDates ◊ Local Admins ◊ Make Choice ◊ Recursive File List ◊ Remove Sizebox Style ◊ Retrieve PNPDeviceID ◊ Retrieve SysListView32 Contents ◊ Set IE Homepage ◊ Tickle Expired Password ◊ Transpose Array Projects: Drive Space Usage GUI ◊ LEDkIT ◊ Plasma_kIt ◊ Scan Engine Builder ◊ SpeeDBurner ◊ SubnetCalc Cool Stuff: AutoItObject UDF ◊ Extract Icon From Proc ◊ GuiCtrlFontRotate ◊ Hex Edit Funcs ◊ Run binary ◊ Service_UDF Link to comment Share on other sites More sharing options...
slayerz Posted October 19, 2008 Share Posted October 19, 2008 Erm..is there any different between ejecting Ipod and common USB drive? AUTOIT[sup] I'm lovin' it![/sup] Link to comment Share on other sites More sharing options...
spudw2k Posted October 19, 2008 Author Share Posted October 19, 2008 Erm..is there any different between ejecting Ipod and common USB drive?Not really. Except there is a difference between ejecting and "safely removing" (even though that's not what you asked). Spoiler Things I've Made: Always On Top Tool ◊ AU History ◊ Deck of Cards ◊ HideIt ◊ ICU ◊ Icon Freezer ◊ Ipod Ejector ◊ Junos Configuration Explorer ◊ Link Downloader ◊ MD5 Folder Enumerator ◊ PassGen ◊ Ping Tool ◊ Quick NIC ◊ Read OCR ◊ RemoteIT ◊ SchTasksGui ◊ SpyCam ◊ System Scan Report Tool ◊ System UpTime ◊ Transparency Machine ◊ VMWare ESX Builder Misc Code Snippets: ADODB Example ◊ CheckHover ◊ Detect SafeMode ◊ DynEnumArray ◊ GetNetStatData ◊ HashArray ◊ IsBetweenDates ◊ Local Admins ◊ Make Choice ◊ Recursive File List ◊ Remove Sizebox Style ◊ Retrieve PNPDeviceID ◊ Retrieve SysListView32 Contents ◊ Set IE Homepage ◊ Tickle Expired Password ◊ Transpose Array Projects: Drive Space Usage GUI ◊ LEDkIT ◊ Plasma_kIt ◊ Scan Engine Builder ◊ SpeeDBurner ◊ SubnetCalc Cool Stuff: AutoItObject UDF ◊ Extract Icon From Proc ◊ GuiCtrlFontRotate ◊ Hex Edit Funcs ◊ Run binary ◊ Service_UDF Link to comment Share on other sites More sharing options...
Skrip Posted October 20, 2008 Share Posted October 20, 2008 Very nice. You should make a way we can interface with it, without iTunes. That would open up so many possibilities. [left][sub]We're trapped in the belly of this horrible machine.[/sub][sup]And the machine is bleeding to death...[/sup][sup][/sup][/left] Link to comment Share on other sites More sharing options...
JRowe Posted October 20, 2008 Share Posted October 20, 2008 AutoPod? Yes, indeed. [center]However, like ninjas, cyber warriors operate in silence.AutoIt Chat Engine (+Chatbot) , Link Grammar for AutoIt , Simple Speech RecognitionArtificial Neural Networks UDF , Bayesian Networks UDF , Pattern Matching UDFTransparent PNG GUI Elements , Au3Irrlicht 2Advanced Mouse Events MonitorGrammar Database GeneratorTransitions & Tweening UDFPoker Hand Evaluator[/center] Link to comment Share on other sites More sharing options...
spudw2k Posted October 20, 2008 Author Share Posted October 20, 2008 (edited) Very nice. You should make a way we can interface with it, without iTunes. That would open up so many possibilities.Interface with the Ipod? That's way beyond my current coding skills. I'd like to one day. Perhaps one day I could attempt to build a UDF to interface with the IPod DB, but I have a feeling this would be a great starting place for anyone. link broken. Edited December 2, 2009 by spudw2k Spoiler Things I've Made: Always On Top Tool ◊ AU History ◊ Deck of Cards ◊ HideIt ◊ ICU ◊ Icon Freezer ◊ Ipod Ejector ◊ Junos Configuration Explorer ◊ Link Downloader ◊ MD5 Folder Enumerator ◊ PassGen ◊ Ping Tool ◊ Quick NIC ◊ Read OCR ◊ RemoteIT ◊ SchTasksGui ◊ SpyCam ◊ System Scan Report Tool ◊ System UpTime ◊ Transparency Machine ◊ VMWare ESX Builder Misc Code Snippets: ADODB Example ◊ CheckHover ◊ Detect SafeMode ◊ DynEnumArray ◊ GetNetStatData ◊ HashArray ◊ IsBetweenDates ◊ Local Admins ◊ Make Choice ◊ Recursive File List ◊ Remove Sizebox Style ◊ Retrieve PNPDeviceID ◊ Retrieve SysListView32 Contents ◊ Set IE Homepage ◊ Tickle Expired Password ◊ Transpose Array Projects: Drive Space Usage GUI ◊ LEDkIT ◊ Plasma_kIt ◊ Scan Engine Builder ◊ SpeeDBurner ◊ SubnetCalc Cool Stuff: AutoItObject UDF ◊ Extract Icon From Proc ◊ GuiCtrlFontRotate ◊ Hex Edit Funcs ◊ Run binary ◊ Service_UDF Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now