Jump to content

how do you close windows with batch?


Recommended Posts


use taskkill

taskkill /F /FI"WINDOWTITLE eq SOMETITLE*"

That will close all windows that begin with SOMETITLE. If you know the exact name, replace SOMETITLE* with the name, if not, just put the first few letters, then put the *, and it will kill all processes that begin with those letters.

Link to comment
Share on other sites

They pop up and remain up and you have to close them manually? Is that what you mean? Or do they just pop up and close themselves.

If its the former then you have some wrong switches applied or as Alanoll said you are installing an app that needs to be "killed" via the taskkill cmd.

Which apps are you having trouble with?

Post your batch_file.cmd here for us to examine and tell us which apps please or we cant help.

Link to comment
Share on other sites

taskkill.exe /f /im explorer.exe

I think this would stop a normal explorer window with program shortcuts in it popping up, added to your cmd on a line below your path_to_switch cmd. But if its a program-specific window thats popping up you'd have to do as Alanoll said and get the name and path of the file that's popping up.

Please test.

Example...

ECHO.

ECHO Installing Whatever App

ECHO Please wait...

start /wait %systemdrive%\Install\Applications\Whatever.exe /s

taskkill.exe /f /im explorer.exe

Link to comment
Share on other sites

taskkill.exe /f /im explorer.exe

I think this would stop a normal explorer window with program shortcuts in it popping up, added to your cmd on a line below your path_to_switch cmd. But if its a program-specific window thats popping up you'd have to do as Alanoll said and get the name and path of the file that's popping up.

Please test.

Example...

ECHO.

ECHO Installing Whatever App

ECHO Please wait...

start /wait %systemdrive%\Install\Applications\Whatever.exe /s

taskkill.exe /f /im explorer.exe

i don't suggest that. That will also kill Windows as well, causing the entire shell to restart. Give it a try in the Task Manager, and kill explorer.exe.

Since they open up start menu folder, write down their names, replace SOMETITLE in the line I gave above with the title. If there are more then one, use MORE THEN ONE taskkill statement with the other name.

What's so complicated about that?

Link to comment
Share on other sites

i don't suggest that. That will also kill Windows as well, causing the entire shell to restart. Give it a try in the Task Manager, and kill explorer.exe.

Since they open up start menu folder, write down their names, replace SOMETITLE in the line I gave above with the title. If there are more then one, use MORE THEN ONE taskkill statement with the other name.

What's so complicated about that?

the explorer.exe trick worked but the taskkill didn't. i think it's because the folders aren't considered an independent process but more like a sub-process of Explorer.exe so when the shell got shut down, it will go along with it.

thanks :D

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...