windows - bat file kill itself? -


we have scheduled task on server, runs bat file copies files 1 machine another. file looks like:

@echo off  net use t: \\xxxxx\copy password /user:xxx\xyz /persistent:yes move t:\*.txt  c:\testfiles  net use t: /delete  taskkill /f /fi "username eq xyz" /im conhost.exe   exit 

when task runs noticed in task manager cmd.exe , conhost.ext started, wanted stop them once task done. killing conhost.ext manually seems kill them both. above bat file runs fine conhost.exe not killed, wasn't sure if can kill itself? running line in bat file works. once task done 2 still showing in task manager.

conhost.exe executed automatically each console application , exits automatically when application exits, don't have kill explicitly. kill cmd.exe.


Comments