Quantcast
Channel: File Services and Storage forum
Viewing all articles
Browse latest Browse all 13565

Running Tasklist command with Administrator Priviledges

$
0
0

Hi,

I am trying to use tasklist command in my bat file to retrieve the list of users running some process say test.exe.

I am using following command in my bat file.

tasklist /v /fo table /nh /fi "IMAGENAME eq test.exe" > C:\temp\output.txt

When I run this bat file as administrator, it works fine and gives the names of users. But, when I run it as some other user, it will give UNKNOWN values in the username coulmn. I have given Full Rights to tasklist.exe in C:\Windows\System32 but still the issue remains. How can I run the bat file with normal user privileges to get the Usernames?

Please help. 

P.S:- I don't want to add the bat file in my Scheduled Task and run the the Task as administrator. That works, but I have to do this without going into making the Scheduled Task.


Bhushan Chanda


Viewing all articles
Browse latest Browse all 13565

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>