New
#1
command file: Opening a window only if not already opened
I am on a Windows 10 Home PC, ver. 21H1. I am a newbie to command files. I've written one to execute a program, and then display my local Temp folder. Unfortunately, if the Temp folder already is displaying in Explorer, the command opens a new instance of that window. How would I modify it to open the Temp window only if it has not already been opened, and otherwise, just give the open Temp window the focus? Thank you.
Here's my code:
@echo off
"C:\Program Files\progManufacturer\progName\prog.exe" -l
%SystemRoot%\explorer.exe %temp%
exit