Closing specific window, but not app in tray - windows

I want to close a window but not app it self (it is running in tray)
There app I need to minimize to tray but there no option to do it in app settings. So I was trying to write bat script to to that.
I got this so far:
:: open app
START C:\"Program Files (x86)"\APP_NAME\APP_NAME.exe
:: close window but not app (doesn't work, kills entire app)
taskkill /fi "windowtitle eq APP_NAME"

You could use nircmd.exe hide in order to hide the desired window. See the following two pages:
NirCmd - Windows command line tool
NirCmd Command Reference - win

Related

Close browser window from cmd

I would like to know how/if it is possible to close a specific browser window from the command line. Say i have 4 windows open for different sites and I want to only one. What would be the command if browser is safari?
Thanks
If you only want to close Safari, you can use:
Taskkill /IM Safari.exe /F

Close an application window without terminating in Command Line

Is there a command on the Windows terminal to close the window of an active application without actually killing the task/process?
What I'm looking for is something similar to clicking the 'X' button on the application window's name bar, or hitting Alt+F4 on it.
Any help would be greatly appreciated. Thanks!
I don't want the taskkill command because it terminates the process. I don't want it to terminate, say I want to close a Skype window so that it pops up in my Notification Tray on my Taskbar.
I couldn't find a specific command on the Windows terminal to do what I wanted, but I found this VBScript code online that did the trick for me.
set shell = createobject("wscript.shell")
shell.appactivate("Skype for Business")
shell.sendkeys "%{F4}"
This simulated an Alt+F4 keypress to Skype, which effectively closed the window and sent it to my Notification Tray.

Windows restart process reload options

I have such problem. I've got Hanvon graphic tablet on a dual-display system. There is an option in tablet settings to select a display to work with, but I do need an opttion to switch monitors on the fly without entering options.
I've found out, that there is some file HWTabletFind.hou that controls the options. So, i've copied two versions of this file - each for one display. And created a *.bat file
#echo off
ren switch.hou temp.hou
ren HWTabletFind.hou switch.hou
ren temp.hou HWTabletFind.hou
taskkill /F /IM Jwpen.exe
start c:\windows\jwpen.exe /runtablet
HWTabletFind.hou is a running options file,
switch.hou are the options for other monitor
jwpen.exe is a process that controlls tablet.
Now the problem: everything works fine, displays are switching. But when I restart jwpen.exe process, all my applications (e.g. Photoshop) do not see my tablet anymore. Tablet works, but in "mouse mode" - no pressure, no tilt, etc. If I restart application, it sees tablet again.
I think, jwpen.exe must run on application initialisation. If it stopps, app thinks, that tablet is disconnected and does not see it again on jwpen.exe start.
Is there a way not to kill and start a process, but to reset it in some way?
If I change display from tablet settings panel, everything works ok. So it's possible to do it via custom script, to run it via hotkey without opening settings.
AutoIt can help to press and click buttons in a script, Autohotkey can do the same by a hotkey, and SENDKEYS via a VBS script can press keys in a GUI too.

Windows 8 - Disable Charms Bar

I'm currently working to disable and lockdown tablets, and am having a hell of a time getting this part disabled. On a touch screen tablet, running windows 8, swiping from the right side of the screen will bring up a charms bar. I want this disabled.
I know this is controlled by a registry value (or multiple values) somewhere, but can't locate them. And I've researched this for hours and hours.
Just a heads up, this has nothing to do with CharmBarHints or the Metro Switcher. This also has nothing to do with my mouse's hardware options. Please, don't give me a fix for a PC running windows 8 that is using a touchpad, it's not the same.
I'm just trying to disable the charms bar for a tablet. Also, I know that windows 8.1 will contain a Kiosk Mode, however that will not be officially released until Oct 17th, and I will be shipping this fix out before then.
Thanks for your help.
You should definitely try going to
1. "COntrol Panel"-> "Mouse" -> "Device Settings" tab-> "Settings" options ->
Uncheck the "Enable Edge Swipes" option
Windows charms bar is operated by explorer.exe. So if your app can run without it then you can hack around it by first disabling the autorestart of explorer.exe via (run as administrator):
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" /v "AutoRestartShell" /t REG_DWORD /d 0
Then the lines below represent my launch.bat - which works in the end as expected:
;; kill explorer (this disables all windows functionalities
taskkill /f /im explorer.exe
;; start your kiosk app - should block the batch execution (so explorer.exe doesn't get executed at the end)
"\path\to\your\app.exe"
;; after you close both the app window and the opened chrome window relaunch explorer.exe to give back the functionality to windows
explorer.exe
I use the approach outlined above to let a keyboardless kiosk app run. Because with a keyboard you can still close the app with alt+f4.
Have you tried this method?
Navigate to the following registry key in Registry Editor:
HKEY_CURRENT_USER>Software>Microsoft>Windows>CurrentVersion>ImmersiveShell
Now go to
ImmersiveShell > New > Key from the context menu, and then name the new Key as EdgeUI.
Right-click the EdgeUI key, point to New, DWORD (32-bit) Value and then name the new DWORD as DisableCharmsHint.
Now double-click the newly created DWORD value, type 1 and click OK. You may also need to reboot Windows for the changes to come into effect.
Once done, it will disable both the top-right and bottom-right hot corners that reveal the Charms Bar.
Source: http://www.techattend.com/disable-charms-bar-in-windows-8-1/

how to miminize a program to tray with a batch file

How would you minimize a running windows service using batch file or cmd lets say firefox.exe to start up and run minimized or minimized to system tray?
You call start /min firefox it will start minimized. However theres a caveat dont do this with Firefox window open because then it will not do this, unless you start a new session. There is no way for batch to start things in the system tray unless the software itself has switches for this. But then that's not a batch issue

Resources