daisensou1979 Posted April 29, 2010 Share Posted April 29, 2010 (edited) Hello, I'm having trouble trying to close some windows using WinClose, here's what I typed in the .au3 file: WinClose ( "", "MountPoint" )As the help file says, it will only close the most recent window if multiple windows match the criteria... so what do I do now?"MountPoint" in this case is part of the path (full path F:\SYS\MountPoint\Flashdrive) I'm using to access the USB flashdrive instead of its real assigned letter I:, because WindowsXP does not save your view\layout preferences for removable media.Reason I'm asking for this is because I started to use a neat application called USB Disk Ejector command line support to replace the native "Safely remove Mass Storage Device" process from Windows XP. Works great, but if I start the process to eject the flashdrive but there is one or more windows open pointing to the MountPoint\Flashdrive path, the process will fail, so I need to manually close them... then I remembered AutoIt could close windows and, and that's why I'm here , I failed to come up with a solution.I've been using AutoIt for a while now, but only for basic stuff (just pasting commands like "FileCopy" and "Run" or using it as a replacement the XP command prompt), so please, don't get mad if the solution is simple and I just overlooked it somehow. Edited April 29, 2010 by daisensou1979 Link to comment Share on other sites More sharing options...
ChrisL Posted April 29, 2010 Share Posted April 29, 2010 While WinExists("", "MountPoint" ) WinClose ( "", "MountPoint" ) Wend [u]Scripts[/u]Minimize gui to systray _ Fail safe source recoveryMsgbox UDF _ _procwatch() Stop your app from being closedLicensed/Trial software system _ Buffering Hotkeys_SQL.au3 ADODB.Connection _ Search 2d Arrays_SplashTextWithGraphicOn() _ Adjust Screen GammaTransparent Controls _ Eventlogs without the crap_GuiCtrlCreateFlash() _ Simple Interscript communication[u]Websites[/u]Curious Campers VW Hightops Lambert Plant Hire Link to comment Share on other sites More sharing options...
daisensou1979 Posted April 29, 2010 Author Share Posted April 29, 2010 Thank you! Link to comment Share on other sites More sharing options...
ChrisL Posted April 29, 2010 Share Posted April 29, 2010 Welcome! Sorry it was a bit of a short reply, I was quite busy at the time! [u]Scripts[/u]Minimize gui to systray _ Fail safe source recoveryMsgbox UDF _ _procwatch() Stop your app from being closedLicensed/Trial software system _ Buffering Hotkeys_SQL.au3 ADODB.Connection _ Search 2d Arrays_SplashTextWithGraphicOn() _ Adjust Screen GammaTransparent Controls _ Eventlogs without the crap_GuiCtrlCreateFlash() _ Simple Interscript communication[u]Websites[/u]Curious Campers VW Hightops Lambert Plant Hire Link to comment Share on other sites More sharing options...
daisensou1979 Posted April 30, 2010 Author Share Posted April 30, 2010 No worries! I was getting some delay in the execution of the script, but solved that by adding the CLASS detail, so it would limit the search only on Windows err... windows. I even solved partially the problem I was having with Windows not saving my view\layout preferences on removable media, by having AutoIt to open the path to the DVD drive and my flashdrive then resizing them to something that fit two columns in tiled view (forced system default). Now the only thing that doesn't work right is the "Sort by" thing, whatever I set as system default it is ignored whenever I access them, but that never did work right anyway. Everything else is fine now. Thanks again! While WinExists ("[CLASS:CabinetWClass]" , "MountPoint") WinClose ("[CLASS:CabinetWClass]" , "MountPoint") Wend Run ("C:\SysTools\USB.exe /showeject /removeletter I") 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