Jump to content
Sign in to follow this  
Jarlax

Killing a process on a remote machine

Recommended Posts

Jarlax

Let me preface my request by saying I'm relatively new to using Autoit so if this is a noobish question, i apologize.

The company i work with recently updated one of their core programs and it has a bug that can cause it to hang instead of closing correctly. I created a batch file that would allow a support person to enter in the IP of a remote machine which would then use the "taskkill" command to end it on that machine. It works great. My issue lies in that they would like a GUI instead of a dos prompt b/c it looks "prettier" or more professional. I can get a dos command to run without issue but I am unclear as to how to send the IP address that gets entered from Autoit to the correct spot in the dos command when i run it. This is not a system process so no special rights should be needed to terminate it. Below is the batch file command lines i was using.

set /p variable="Please the Enter IP Address: "

taskkill /s \\%variable% /f /IM ProcessName.exe /t

I was using a simple InputBox command to enter the IP in Autoit. Any help would be greatly appreciated. Thanks!

Share this post


Link to post
Share on other sites
JSThePatriot

Jarlax,

If you could provide your AutoIt code, and let us know where it's exactly breaking. If I see the AutoIt code, and compare it to that batch program, I am relatively certain myself or a lot of people here would be able to assist you in making sure it's correctly done. However, when you don't provide you're own code that you've tried you're essentially asking us to translate your code to AutoIt, and we prefer to teach than to just simply work.

Thanks,

Jarvis


AutoIt Links

File-String Hash Plugin Updated! 04-02-2008 Plugins have been discontinued. I just found out.

ComputerGetInfo UDF's Updated! 11-23-2006

External Links

Vortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more)

Share this post


Link to post
Share on other sites
Jarlax

Not a problem. Here is the code as it stands in its non working state. I know someone is giggling at my noobishness. /fail at Autoit >_<

$ipaddress = InputBox("Process Termination Tool","This tool will attempt to kill the Program processes on a remote machine" & @CRLF & "Please Enter the IP Address:")
        Run(@ComSpec & " /c taskkill \\" & $ipaddress & " /F /IM ProcessName.exe", '', @SW_SHOW)

Share this post


Link to post
Share on other sites
Jarlax

yup, definitely had a stupid attack. The Autoit code works great. My dos syntax was wrong. it should read like this:

$ipaddress = InputBox("Process Termination Tool","This tool will attempt to kill the Program processes on a remote machine" & @CRLF & "Please Enter the IP Address:")
        Run(@ComSpec & " /c taskkill /s \\" & $ipaddress & " /F /IM ProcessName.exe", '', @SW_SHOW)

Share this post


Link to post
Share on other sites
JSThePatriot

Jarlax,

Thanks for providing code, and good job on figuring it out yourself! Welcome to the AutoIt community, and I hope there are many more things you can use AutoIt to help you do!

Jarvis


AutoIt Links

File-String Hash Plugin Updated! 04-02-2008 Plugins have been discontinued. I just found out.

ComputerGetInfo UDF's Updated! 11-23-2006

External Links

Vortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×