Closing only a window of an active application via .bat file - windows

I am looking for a solution to close a window and leave the .exe running.
The .bat file:
#echo off
TITLE Bejelentkezes ujrainditasa
TASKKILL /F /im eszig-eid.exe
TASKKILL /F /im eszig-cmu.exe
start /d "C:\Program Files (x86)\ESZEMELYI\eSzemelyi_Kliens" eszig-cmu.exe
So, the eszig-cmu.exe must stay running, but when the code executes it opens the window of the program, and I don't need it. I want to close only the window of the application, like how I mentioned and leave the .exe (the active program) running! I also apply the solution in PowerShell! I only curious about the solution!

Related

How to close cmd window openned bat file with another bat file or program

I created a node.js program, and I run it using the following .bat file:
cd C:\Users\user\Documents\programmingStuff\jsProgramsFolder
node .
#pause
I now want to close the cmd window created by this specific bat file with another bat file or program.
Searching for the answer only provided results for how to close the window in the same bat file.
Is this possible? If so, how can it be done?
taskkill lets you filter by window title, and title lets you set the window title.
In the script that you have posted, add the line title NodeLauncher (you can call it something else as long as it's unique to this particular window.)
In another batch file, run taskkill /IM cmd.exe /FI "WINDOWTITLE eq NodeLauncher"

Running an .exe after another closes using .bat file

I'm playing an old game that conflicts with the Windows Graphical Shell for Windows 7 and doesn't allow it to display properly so I simply go into Task Manager (TM) and close explorer.exe and the game displays fine but in order for me to enable explorer.exe I need to go into TM and start a new task for it to come back. I was wonder if there was a way to write a .Bat file that would kill explorer.exe launch my game and once the game closes it would simply run the task for me instead of manually needing to turn it back on.
taskkill /f /IM explorer.exe
start CNC95Launcher.exe
this is what i have so far
The start causes windows to launch your program asynchronously - that is, it will start it, then continue with the next instruction without waiting for your app to close.
Try this:
taskkill /f /IM explorer.exe
start /wait CNC95Launcher.exe
start explorer.exe
You probably don't actually need the start for explorer, because it's that kind program.
I use this (on window 7):
taskkill /F /IM Explorer.exe
*.exe
Start explorer.exe
replace * with the exe name that launches the actual game not a pre launch menu and save as .bat in the same folder directory.
It works for Star Wars Galactic Battlegrounds and AoE which can suffer weird colour issues if explorer runs.

Closing a window which pops up while running batch file

There is this application build process that I am trying to automate. For this i wrote a java file, which runs every 24 hours.
A batch file is called from here that runs the application build whenever it is called.
I've run into a small problem, when the build fails due to incomplete or invalid files, a window pops up which tells me to look at the logs.
Since I haven't written the build files, I'm not really sure where this gets created from. I wanted to know if I can close this window while the process runs from the bat file.
It may be possible using taskkill, but you'd have to devise a filter that would ideally only match the process displaying the window and never match any other process. Something like:
taskkill /im program.exe
or maybe:
taskkill /fi "windowtitle eq title*"
You might also want to include the /f flag for forceful termination.
You'd also have to try and make sure that the taskkill command doesn't run too quickly and precede the creation of the popup window. You could try to query for the existence of such a process/window; your best bet here is probably wmic. Maybe:
#echo off
setlocal enabledelayedexpansion
set title=Notepad
set pid=
for /f %%i in ('wmic process where "caption like \"%%!title!%%\"" get processid^| findstr /r [0-9]') do #set pid=%%i
if "!pid!" neq "" taskkill /f /pid !pid!
There's no guarantee this will always work, but it's probably the best you can do.

Start window 64 bit explorer.exe from 32 bit installer

My Question: I need to kill the explore.exe and start the explorer.exe on 64 bit machine using 32 bit installer. If i created the batch file and double click on the batch file then it work fine but when i integrate in installer, it failed.
I execute below mentioned command but not able to succeed.
When i executed the below command, it kill the task bar and create the explorer.exe but not shown the taskbar.
taskkill /F /IM explorer.exe
cd C:\Windows\Sysnative
start /B explorer.exe
When i executed the below command, it kill the task bar and create the explorer.exe but shown the taskbar and hang the installer.
taskkill /F /IM explorer.exe
%systemroot%\sysnative\cmd.exe /c start /B explorer.exe
Please suggest me how solve this problem.
Thanks in advance.

batch file restart or close running programs with time with no warning message

i'm working with batch file right now, I am trying to run a batch file that will restart or close a program with a given time with no warning message(for restart). is this possible? i know how to restart using a batch file but i can't find a way to hide or not show the warning message. tnx
Taskkill /?
taskkill /f /im notepad.exe

Resources