zFrank Posted August 19, 2008 Share Posted August 19, 2008 hi, i am automating a wireless drivers installation setup. therefore i need to know... 1- how to pause the script until a Removable device is inserted? 2- how to safely remove a removable device? many thanks in advance for the help! [font="Georgia"]GSM Expert[/font] but not AutoIt :DProud to be Admin Of : http://www.gsmhosting.net/visit my Forum... http://www.gsmhosting.net/vbb/index.php$Life = "Happy" If @Error Then $Life = "Risk" Link to comment Share on other sites More sharing options...
zFrank Posted August 19, 2008 Author Share Posted August 19, 2008 anyone please help... [font="Georgia"]GSM Expert[/font] but not AutoIt :DProud to be Admin Of : http://www.gsmhosting.net/visit my Forum... http://www.gsmhosting.net/vbb/index.php$Life = "Happy" If @Error Then $Life = "Risk" Link to comment Share on other sites More sharing options...
Andreik Posted August 19, 2008 Share Posted August 19, 2008 Use Scriptomatic, maybe you'll find what you want. When the words fail... music speaks. Link to comment Share on other sites More sharing options...
zFrank Posted August 19, 2008 Author Share Posted August 19, 2008 what is Scriptomatic and where can i find it? is there no other way to do it? i mean i want to wait for the device to be connected. [font="Georgia"]GSM Expert[/font] but not AutoIt :DProud to be Admin Of : http://www.gsmhosting.net/visit my Forum... http://www.gsmhosting.net/vbb/index.php$Life = "Happy" If @Error Then $Life = "Risk" Link to comment Share on other sites More sharing options...
Andreik Posted August 19, 2008 Share Posted August 19, 2008 what is Scriptomatic and where can i find it? is there no other way to do it? i mean i want to wait for the device to be connected.Scriptomatic is here When the words fail... music speaks. Link to comment Share on other sites More sharing options...
iceberg Posted August 19, 2008 Share Posted August 19, 2008 http://www.autoitscript.com/forum/index.ph...hl=scriptomatic mouse not found....scroll any mouse to continue. Link to comment Share on other sites More sharing options...
zFrank Posted August 19, 2008 Author Share Posted August 19, 2008 i have not good knowledge of WMI and Scriptomatic tool, please tell me any easy way. i am new... many thanks! [font="Georgia"]GSM Expert[/font] but not AutoIt :DProud to be Admin Of : http://www.gsmhosting.net/visit my Forum... http://www.gsmhosting.net/vbb/index.php$Life = "Happy" If @Error Then $Life = "Risk" Link to comment Share on other sites More sharing options...
zFrank Posted August 19, 2008 Author Share Posted August 19, 2008 i want to stop the script to work until the Removable device is ready... [font="Georgia"]GSM Expert[/font] but not AutoIt :DProud to be Admin Of : http://www.gsmhosting.net/visit my Forum... http://www.gsmhosting.net/vbb/index.php$Life = "Happy" If @Error Then $Life = "Risk" Link to comment Share on other sites More sharing options...
AoRaToS Posted August 19, 2008 Share Posted August 19, 2008 (edited) maybe this can help you, it's from one of my scripts... expandcollapse popup#include <Process.au3> #include <Constants.au3> #NoTrayIcon Global $UsbDrive Opt("TrayOnEventMode",1) Opt("TrayMenuMode",1) ; Default tray menu items (Script Paused/Exit) will not be shown. Call("USBListen") ; FunctionsTraySetState() Func USBListen() $strComputer = "." $objWMIService = ObjGet("winmgmts:\\" & $strComputer & "\root\cimv2") $colEvents = $objWMIService.ExecNotificationQuery _ ("Select * From __InstanceOperationEvent Within 5 Where " _ & "TargetInstance isa 'Win32_LogicalDisk'") While 1 $objEvent = $colEvents.NextEvent If $objEvent.TargetInstance.DriveType = 2 Then Select Case $objEvent.Path_.Class()="__InstanceCreationEvent" $UsbDrive = $objEvent.TargetInstance.DeviceId TraySetIcon("warning") TraySetState() TraySetToolTip($objEvent.TargetInstance.DeviceId) TrayTip("","Drive " & $objEvent.TargetInstance.DeviceId & " has been added." & @CR,3,0) Sleep(500) _RunDOS("start " & $objEvent.TargetInstance.DeviceId & "\test.txt") Case $objEvent.Path_.Class()="__InstanceDeletionEvent" TraySetToolTip($objEvent.TargetInstance.DeviceId) TrayTip("","Drive " & $objEvent.TargetInstance.DeviceId & " has been removed."& @CR,3,0) Sleep(3000) TraySetState(2) EndSelect EndIf WEnd EndFunc Func ExitEvent() Exit EndFunc Also, post your script and I'll try and edit it to do what you want if you can't Edited August 19, 2008 by AoRaToS s!mpL3 LAN Messenger Current version 2.9.9.1 [04/07/2019] s!mpL3 LAN Messenger.zip s!mpL3 Link to comment Share on other sites More sharing options...
zFrank Posted August 19, 2008 Author Share Posted August 19, 2008 (edited) thanks a lot but i have also tried and succeed... something like this $DISK = DriveGetDrive("REMOVABLE") For $I = 1 To $DISK[0] $STATS = DriveStatus($DISK[$I]) If $STATS = "READY" Then Msgbox(0, "Whatever", "Drive is ready") EndIf Next can i do it by some other way? Edited August 19, 2008 by zFrank [font="Georgia"]GSM Expert[/font] but not AutoIt :DProud to be Admin Of : http://www.gsmhosting.net/visit my Forum... http://www.gsmhosting.net/vbb/index.php$Life = "Happy" If @Error Then $Life = "Risk" Link to comment Share on other sites More sharing options...
zFrank Posted August 21, 2008 Author Share Posted August 21, 2008 still don't know... how to safely remove a removable device? anyone please help! [font="Georgia"]GSM Expert[/font] but not AutoIt :DProud to be Admin Of : http://www.gsmhosting.net/visit my Forum... http://www.gsmhosting.net/vbb/index.php$Life = "Happy" If @Error Then $Life = "Risk" Link to comment Share on other sites More sharing options...
rasim Posted August 23, 2008 Share Posted August 23, 2008 still don't know...how to safely remove a removable device?anyone please help!See here 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