Is there a way to close a single window of a process from a BAT file? -


here's situation:

i have windows 7 computer set every morning, task runs plays alarm , causes morning routine open (in wordpad window). thing is, have window automatically close @ time when leave work don't have cluttering desktop after work. after all, if window open, kind of ruins purpose reminder.

ideally, way close wordpad window containing other wordpad windows have open not affected. killing task close wordpad windows (probably regardless of whether have unsaved data or not).

so there way close specific window (not whole process) windows batch file? or else can run task scheduler, suppose.

sure. use tasklist find window based on title, taskkill kill pid.

@echo off setlocal  /f "skip=3 tokens=2" %%i in (     'tasklist /fi "windowtitle eq reminders.rtf - wordpad"' ) taskkill /im "%%i" 

or just

taskkill /fi "windowtitle eq reminders.rtf - wordpad" 

Comments

Popular posts from this blog

powershell Start-Process exit code -1073741502 when used with Credential from a windows service environment -

twig - Using Twigbridge in a Laravel 5.1 Package -

c# - LINQ join Entities from HashSet's, Join vs Dictionary vs HashSet performance -