c00kie88
asked on
Taskkill syntax / script
Hi ,
How do i use Taskkill to terminate program except if runs under SYSTEM and local_admin?
I have it as below - it works but if i want both SYSTEM & local_admin? I have tried using AND or & symbol but not working
taskkill /f /fi "imagename eq hello.EXE" /fi "username ne SYSTEM"
Any idea?
How do i use Taskkill to terminate program except if runs under SYSTEM and local_admin?
I have it as below - it works but if i want both SYSTEM & local_admin? I have tried using AND or & symbol but not working
taskkill /f /fi "imagename eq hello.EXE" /fi "username ne SYSTEM"
Any idea?
Try
tasklist fi "username ne system" /fi "imagename eq some prices.e e"
The same options for tasklist eq taskkill.
tasklist fi "username ne system" /fi "imagename eq some prices.e e"
The same options for tasklist eq taskkill.
Hi,
try this one
@echo off
taskkill /f /im hello.exe
pause
try this one
@echo off
taskkill /f /im hello.exe
pause
ASKER
Hi Adam,
I tried below, but still close the program when i login as administrator
@ECHO on
if '%username%' == 'system' goto end
if '%username%' == 'administrator' goto end
taskkill /f /fi "imagename eq hello.EXE"
:end
exit
I tried below, but still close the program when i login as administrator
@ECHO on
if '%username%' == 'system' goto end
if '%username%' == 'administrator' goto end
taskkill /f /fi "imagename eq hello.EXE"
:end
exit
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Open in new window