Jump to content
Sign in to follow this  
bobheart

kill process

Recommended Posts

bobheart

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
Valik

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
bobheart

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

Share this post


Link to post
Share on other sites
bobheart

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
this-is-me

Don't use quotes around variables.


Who else would I be?

Share this post


Link to post
Share on other sites
bobheart

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
Jos

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:

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites
bobheart

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
Jos

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

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites
bobheart

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
bobheart

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
bobheart

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
Jos

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:

:(


SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites
bobheart

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
this-is-me

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  

×