ZTree.com  | ZEN  | About...  

 Index   Back

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

By: Peter Shute       
Date: May 04,2020 at 20: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.

57 views      
 

Messages in this Thread

 
94,957 Postings in 11,969 Threads, 349 registered users, 20 users online (0 registered, 20 guests)
Index | Admin contact |   Forum Time: May 25, 2020 - 4:33 am EDT  |  Hits:31,224,936  (1,283 Today )
RSS Feed