This will open MyFolder in Explorer
explorer "C:\Users\Username\Desktop\MyFolder"
I'd like it to only do this if it isn't already opened.
Otherwise the the folder gets opened multiple times
This is for windows cmd batch
Thanks
This will open MyFolder in Explorer
explorer "C:\Users\Username\Desktop\MyFolder"
I'd like it to only do this if it isn't already opened.
Otherwise the the folder gets opened multiple times
This is for windows cmd batch
Thanks
If the path doesn't need quotes:
start C:\Users\Username\Desktop\MyFolder
If the path does need quotes:
start "" "C:\program files"
Check the listWindows.bat (unfortunately I think tasklist does not handle the window titles of the explorer.exe windows). It will list all opened windows and the name of the executable they belong to.The windows that are opened by the explorer will have the folder name as a title (only the name - without the whole path) so you can try this:
call listWindows.bat|find /i "explorer::MyFolder" >nul 2>&1 || (
explorer "C:\Users\Username\Desktop\MyFolder"
)