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.

Thread locked

Messages in this Thread

95,245 Postings in 12,014 Threads, 350 registered users, 32 users online (0 registered, 32 guests)
Index | Admin contact |   Forum Time: Jan 16, 2021 - 12:41 pm UTC  |  Hits:36,841,779  (5,711 Today )
RSS Feed