April 19, 200521 yr Is there a way to kill a start menu folder during runonceex? I know about Internet Explorer, but the only thing I can figure is explorer.exe which would kill the shell, right?Reason I ask is because Macromedia Studio, which I've decided to use an AutoIt script for (because of the Flash plugin) opens both a webpage from Macromedia as well as the program group folder in the start menu. I can kill the website, but what about the folder?
April 20, 200521 yr As far as I understand it, RunOnceEx runs prior to the explorer shell starting up, if this is the case then you should be able to kill explore.exe to close it down.Easy way to test... while your runonce is running, hit Ctrl Alt Del.. thatll bring up task mgr and you can see for yourself.Post up your results
April 20, 200521 yr Reason I ask is because Macromedia Studio, which I've decided to use an AutoIt script for (because of the Flash plugin) opens both a webpage from Macromedia as well as the program group folder in the start menu. I can kill the website, but what about the folder?In Autoit, this will close the window, but if still exists, it will try for up to 5 secs. Just that sometimes, a second close message is required, in RunOnceEx.$title = "TheTitleHere"WinWait($title)For $i = 1 To 20 WinClose($title) If Not WinExists($title) Then ExitLoop Sleep(250)Next
April 20, 200521 yr You could use the SendKeys command in vbScript to send an ALT+F4 command to close the window.See the MS Technet Script Center for example of how to use SendKeys.Then just call the .vbs file from your RunOnceEx.cmd.
April 20, 200521 yr Author Well, considering I'm already using AutoIt, I might as well stick to that.Here's an interesting question, though. Let's say I don't know exactly what the title of the window is that I'm trying to close. For instance, it could be just the name of the folder, or in my preconfigured case could be the entire path including the drive letter. Considering this is a variable and not a constant (given different computer setups), what would be the best method. Does AutoIt use regular expressions (I haven't had a chance to research this just yet)? Would it be best to search the title for a given set of characters and then issue that a close command?Incidentally, thanks for the input.
April 21, 200521 yr Author No, not yet. I have to re-setup the OS portion of the CD. I just finished the application portion of it earlier and I'm going to give it a test before I hit the sack tonight (will know by morning what the outcome is).
April 21, 200521 yr Well, considering I'm already using AutoIt, I might as well stick to that.Here's an interesting question, though. Let's say I don't know exactly what the title of the window is that I'm trying to close. For instance, it could be just the name of the folder, or in my preconfigured case could be the entire path including the drive letter. Considering this is a variable and not a constant (given different computer setups), what would be the best method. Does AutoIt use regular expressions (I haven't had a chance to research this just yet)? Would it be best to search the title for a given set of characters and then issue that a close command?Incidentally, thanks for the input.Regular expressions are still in beta. You can close the active window, by just using "" instead of giving a title. Also, WinGetHandle() is an option as well, instead of the title. You could change the Opt() setting for window text to 2. Then you can pick a substring, witch can be part of the name of the folder only.I would not close the explorer process, while running Autoit scripts. This is a brutal method for a simple problem. This could affect the outcome of your script, unless you insert some code to handle this process. Asking a window to close, is better then killing a main system process.
April 21, 200521 yr I would look for a program called PSKILL.exe. I have noticed on my Unattended Windows 2003 Server installations that TASKKILL.exe doesn't exist on Servers. My point being is that PSKILL.exe has a few more options.Microsoft Windows XP [Version 5.1.2600]© Copyright 1985-2001 Microsoft Corp.C:\>w:W:\>pskill /?PsKill v1.03 - local and remote process killerCopyright © 2000 Mark Russinovichhttp://www.sysinternals.comPsKill terminates processes on a local or remote NT system.Usage: pskill [\\RemoteComputer [-u Username]] <process Id or name> -u Specifies optional user name for login to remote computer.W:\>
April 21, 200521 yr The point of this thread is that nobody is clear on what the actual process is that should be killled... not how you should kill it
April 22, 200521 yr Author Agreed. I still haven't had a chance to check if explore.exe is running during runonceex as of yet since my unattended dvd is messed up (I have a seperate thread on that issue in the proper forum). As soon as I've worked through that issue, I'll post back here on my results.
April 22, 200521 yr Author explorer.exe is running during the runonceex. I was wrong about the folder opening, though. The folder doesn't open until runonceex finishes and the user account opens. Same is true for the internet explorer window that it opens. Is there any way to avoid having those open after the next boot?
March 24, 200719 yr tries this, it functioned with me.;Cleanup Open Start Menu FolderSleep(1000)$handle = WinGetHandle("WinRAR - explorer", "")WinClose($handle)
Create an account or sign in to comment