Link to home
Start Free TrialLog in
Avatar of tiras gans
tiras gansFlag for United States of America

asked on

Need to kill the procexp64.exe

People leave the process running and I like to schedule to kill it every night.  I know its very easy with SysInternals, would be "pskill procexp".  How can I script it for all the server in one script and put that script into the schedule.
ASKER CERTIFIED SOLUTION
Avatar of David Johnson, CD
David Johnson, CD
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of tiras gans

ASKER

The listservers.txt should I just put hostnames each in every line?
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I am using procexp64 so I put
[for %i in (C:\path\server.txt) do pskill \\%i procexp64]
Still not killing for some reason..
Make sure that the default admin$ share is enabled on C:\path\server.txt.
hmmm
it tells me same on every system even though the Admin$ is enabled.
removed \\%i and works now from the command like but not as batch.   weird!
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
like this?

for %%i in (C:\path\server.txt) do pskill \\%%i procexp64

pause
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
not working :-((
If you have any idea on how to troubleshoot here let me know.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Still not killing even from the command line.  
When I do like this its working. But not from \\servername procexp64.  Weird.
C:\Procexp>pskill procexp64

PsKill v1.13 - Terminates processes on local or remote systems
Copyright (C) 1999-2009  Mark Russinovich
Sysinternals - www.sysinternals.com

Process procexp64 killed.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Yes, I have Admin privileges and access to the server.  pslist:

C:\Procexp>pslist \\server1

pslist v1.29 - Sysinternals PsList
Copyright (C) 2000-2009 Mark Russinovich
Sysinternals

Cannot connect to remote registry on server1
Access is denied.
Failed to take process snapshot on server1.
Make sure that the Remote Registry service is running on the remote system, that
 you havefirewall ports allow RPC access, and your account has read access the f
ollowing key on the remote system:
HKLM\Software\Microsoft\Windows NT\CurrentVersion\Perflib

**Server name edited out per OP request.**-JARmod101
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
same thing...  The account  I am using has domain admin privileges.
Drive mapping not working either?
I think there is an issue with local shares.  
When i go \\server1 from the same server1 it promts me for the logins.  If I do from \\server2 from server1 it works file. Same as vice versa for other shares.  That could be an issue.
Yes, this is most likely the issue, I already concluded that the script itself was working just fine.
Yes, let me address that portion.

C:\Procexp>pskill \\server1 procexp64

PsKill v1.13 - Terminates processes on local or remote systems
Copyright (C) 1999-2009  Mark Russinovich
Sysinternals - www.sysinternals.com

Process procexp64 killed on server1.

So it works from the command line.  It doesn't work inside the script though.
From server1 to server1? Then you dont need \\server1, just pskill procexp64 - can you test that (on server1)?
No from server1 to other servers.

=============================================
for /f %%i in (servers.txt) do echo pskill \\%%i procexp64

pause
==============================================
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Yes perfect works now.  Just need to find out why doesn't work on the same machine..
One more question.  How can I make it run on the background?  So users do not see it when its scheduled?
Nevermind there is an option Hidden in the Task Manager in Windows 2008 Server.   That should take care I assume.
Thanks!