ZTree.com  | ZEN  | About...  

 Index   Back

Start Z: works, but how to kill it?   [OT]

By: Peter Shute       
Date: May 05,2020 at 00:26
In Response to: Start Z: works, but how to kill it? (Peter Shute)

> I found a suggestion to do this:
> start /min N:\
> timeout 2 /nobreak
> taskkill /im explorer.exe /fi "WINDOWTITLE eq N:\\"
>
> But the titles of my explorer windows aren't that simple. They include
> the share name too. And even if I include them in teh command, it keeps
> saying "INFO: No tasks running with the specified criteria."
>
> I tried "tasklist /fi "imagename eq explorer.exe" /v" but it lists
> the window title as N/A.

If you do this in Explorer first, it works:
- click on View then Options then Change Folder and Search Options
- click on the View tab
- Enable Display the full path in the title bar
- Enable Launch folder windows in a separate process

But oddly, "tasklist /fi "imagename eq explorer.exe" /v" now only lists two tasks, no matter how many Explorer windows are open. It shows the main one, and the most recently opened one. Which is fine, as the latter is the one to be killed.

Looks like you don't really have to enable "Display the full path in the title bar". You could still kill it with:
taskkill /im explorer.exe /fi "WINDOWTITLE ne xyz"

Sounds like a lot of bother though.

876 views      
Thread locked
 

Messages in this Thread

 
96,631 Postings in 12,230 Threads, 350 registered users, 87 users online (0 registered, 87 guests)
Index | Admin contact |   Forum Time: Mar 19, 2024 - 10:40 am UTC  |  Hits:62,015,075  (12,356 Today )
RSS Feed