Help - Search - Members - Calendar
Full Version: Killing a Start Menu Folder
MSFN Forums > Unattended Windows Discussion & Support > Application Installs

   


Google Internet Forums Unattended CD/DVD Guide
TheJerk
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?
durex
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
MHz
QUOTE (TheJerk @ Apr 20 2005, 06:39 AM)
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.
CODE
$title = "TheTitleHere"
WinWait($title)

For $i = 1 To 20
    WinClose($title)
    If Not WinExists($title) Then ExitLoop
    Sleep(250)
Next
tguy
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.
TheJerk
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.
durex
Did you try the taskkill explore.exe?
TheJerk
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).
MHz
QUOTE (TheJerk @ Apr 21 2005, 02:11 AM)
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.
durex
But are you even sure that explore.exe is even running at this stage?
pdmcmahon
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 killer
Copyright © 2000 Mark Russinovich
http://www.sysinternals.com

PsKill 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:\>
durex
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
TheJerk
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.
TheJerk
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?
pecha
tries this, it functioned with me.

;Cleanup Open Start Menu Folder
Sleep(1000)
$handle = WinGetHandle("WinRAR - explorer", "")
WinClose($handle)




Google Internet Forums Unattended CD/DVD Guide

This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.