1

I'm using Task Scheduler to launch SoundID Reference.exe, a third-party program, 60 seconds after my Win 10 64-bit computer starts up. That's working fine.

I would like to create a batch command to close SoundID's window, after the program starts up. I'm trying to figure out how to do this via nircmd.exe, though I'm confused by the documentation and examples.

I've got nircmd.exe in one of my user directories, since my system didn't allow me to copy it to the Windows directory.

Here's the batch command I've been working with, unsuccessfully:

C:\Users\USERNAME\nircmd win close title "SoundID Reference.exe"

What is the correct syntax/approach to get this to work properly?

This is how the window appears in the task bar:

taskbar view of SoundID Reference

Here's the actual program window:

SoundID window

This is what I see for SoundID when I run tasklist /v in a CMD prompt:

enter image description here

BTW SoundID runs multiple processes. I'm just trying to close the single 'Systemwide' window.

From Task Manager:

view of SoundID Reference in Task Manager

DavidPostill
  • 153,128
  • 77
  • 353
  • 394
  • If you are going to use `win close title "SoundID Reference.exe" `, you need to figure out what the actual title bar for the window is. I *almost* guarantee that it isn't the name if the exe (which is what you are using), – Señor CMasMas Apr 29 '22 at 18:35
  • Thanks, Señor CMasMas. Just emailed support for the company that makes SoundID, asking for the window title. I wonder if anyone can suggest an easy way to get the window title, in the meanwhile. – movingroovin Apr 30 '22 at 18:10
  • 1
    Have you tried `nircmd win close title "SoundID Reference"` without the `.exe` bit? – vbnm May 01 '22 at 23:43
  • Thank you, vbnm 1. Your suggestion seems like a good idea, but I'd already switched to AutoHotKey. – movingroovin May 02 '22 at 01:32

2 Answers2

1

I've made some progress with this. The following uses AutoHotKey, instead of NirCmd.

winTitle = SoundID Reference
If WinExist(winTitle) {
WinActivate

Send !{F4}
}
ExitApp

Closing the window allows SoundID Reference's processes to remain active, accessible from the Taskbar tray.

The first four lines are from AHK's template:

#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn  ; Enable warnings to assist with detecting common errors.
SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory. 

winTitle = SoundID Reference
If WinExist(winTitle) {
WinActivate Send !{F4} } ExitApp

  • judging by your answer, @vbnm was on the money. ;) If you really want to help the community out, try nircmd with the same string and see if it works (and continue with autohotkey). if it does, ADD it to your answer to help the next person. :) – Señor CMasMas May 02 '22 at 15:22
0

Per @Señor CMasMas suggestion, I tested with Nircmd, using the syntax suggested by @vbnm.

nircmd win close title "SoundID Reference" actually quits the underlying processes, rather than merely closing the window.

I suppose that nircmd could provide the same functionality if it merely closed the window with alt-F4. Unfortunately, that's all the testing and reporting time I've got left for this.

Thanks all.