Skip to content
View in the app

A better way to browse. Learn more.

MSFN

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Killing a Start Menu Folder

Featured Replies

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?

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

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

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.

  • 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.

  • 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).

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.

But are you even sure that explore.exe is even running at this stage?

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:\>

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

  • 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.

  • 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?

  • 1 year later...

tries this, it functioned with me.

;Cleanup Open Start Menu Folder

Sleep(1000)

$handle = WinGetHandle("WinRAR - explorer", "")

WinClose($handle)

Create an account or sign in to comment

Recently Browsing 0

  • No registered users viewing this page.

Account

Navigation

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.