Sign in to follow this  
Followers 0
bobheart

kill process

17 posts in this topic

I want to run a small app that will kill a process but need to use a input box .

I have this but it is trying to run the name process and not the kill program .

What do I have wrong and how can I fix it ?

Dim $Process
$Process = InputBox("$Process", "Process to kill?", ".exe", "", -1, -1, 0, 0)
;Places the input box in the top left corner displaying the characters as they are typed.
if $Process then
Run(@ComSpec & " /k pskill.exe & $Process & ")
else 
    Exit
EndIf

Share this post


Link to post
Share on other sites



There are quotes around the entire string in the Run() command.

Wouldn't it be easier to use ProcessClose()?

Share this post


Link to post
Share on other sites

I'll give that a try , I forgot about it . lol

Share this post


Link to post
Share on other sites

Same thing ? what do I have wrong here Valik .. I think I need to see how it is done then I will get it . lol

Dim $Process
$Process = InputBox("$Process", "Process to kill?", ".exe", "", -1, -1, 0, 0)
ProcessClose("$Process")
MsgBox(4096, "Test", $Process, 10)

Share this post


Link to post
Share on other sites

Don't use quotes around variables.


Who else would I be?

Share this post


Link to post
Share on other sites

Still can't get it to work ?

Dim $Process
InputBox($Process, "Process to kill?", ".exe", "", -1, -1, 0, 0)
ProcessClose($Process)
MsgBox(4096, "Test", $Process, 10)

Share this post


Link to post
Share on other sites

Still can't get it to work ?

Dim $Process
InputBox($Process, "Process to kill?", ".exe", "", -1, -1, 0, 0)
ProcessClose($Process)
MsgBox(4096, "Test", $Process, 10)

<{POST_SNAPBACK}>

Did you check the value of $Process? with this code it will be ""/blank/empty.

The result of an InputBox should be infront of an equal sign....

$answer = InputBox("Question", "Where were you born?", "Planet Earth", "", -1, -1, 0, 0)

:ph34r:

Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

So your saying it should look like this ?

InputBox("Process to kill?:, $Process, ".exe", "", -1, -1, 0, 0)

Share this post


Link to post
Share on other sites

#9 ·  Posted (edited)

So your saying it should look like this ?

InputBox("Process to kill?:, $Process, ".exe", "", -1, -1, 0, 0)

<{POST_SNAPBACK}>

no... thats not what i am saying.

why did you change the below line that was in the previous version?

$Process = InputBox("$Process", "Process to kill?", ".exe", "", -1, -1, 0, 0)

:ph34r:

Edited by JdeB

Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

You know whats funny , I got it working in one hour with ahk but I can never get anything to work au3 ?

Share this post


Link to post
Share on other sites

You know whats funny , I got it working in one hour with ahk but I can never get anything to work au3 ?

<{POST_SNAPBACK}>

.... meaning? :ph34r:

Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

I got it to work now .

Dim $Process

$Process = InputBox($Process, "Process to kill?", ".exe", "", -1, -1, 0, 0)

ProcessClose($Process)

MsgBox(4096, "Test", $Process, 10)

Share this post


Link to post
Share on other sites

You know whats funny , I got it working in one hour with ahk but I can never get anything to work au3 ?

<{POST_SNAPBACK}>

I never know where to put the "" .

Or the & .

Share this post


Link to post
Share on other sites

I never know where to put the "" .

Or the & .

<{POST_SNAPBACK}>

Don't think thats much different in V2 or AHK.. but thats why we invented F1... :ph34r:

:(


Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

Don't think thats much different in V2 or AHK.. but thats why we invented F1

F1? whats that going to do ?

Share this post


Link to post
Share on other sites

Don't think thats much different in V2 or AHK.. but thats why we invented F1

F1? whats that going to do ?

<{POST_SNAPBACK}>

yea right... :ph34r:

Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

F1 is help.

@jdeb, if you read his signature, you will see he has a disibility.


Who else would I be?

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  
Followers 0