a little help would do me good

Deploying to Windows? Utilizing VB Script execution? This is the place to ask Windows-specific questions.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
shadowslash
Posts: 344
Joined: Tue Feb 24, 2009 6:14 pm
Contact:

a little help would do me good

Post by shadowslash » Thu Mar 05, 2009 8:42 pm

i wanted to make a task manager-like program in windows and i need to know how to kill a process using the kill command and not the shell("taskkill /f /im "processname.exe") style.. i wouldn't want cmd windows popping up every now and then whenever the program tries to close a process... i tried "kill "processname.exe" but it didn't do the job.. i also tried "kill "C:/processname.exe"" but still it wouldn't quit the application.. if you're asking if i wanna close a process that wasn't started by my revolution program, YES. i want it to close another process that it didn't start up.. if you could help me, you'd make my day for sure :(
Parañaque, Philippines
Image
Image

SparkOut
Posts: 2945
Joined: Sun Sep 23, 2007 4:58 pm

Post by SparkOut » Thu Mar 05, 2009 9:18 pm

Do it the shell ("taskkill") way but simply in the handler script before you call the shell task, put the line "set the hideConsoleWindows to true" which will stop the command console window from being displayed while the process is stopped.
You will probably fail with that taskkill structure you have on account of the quoting. So something thus should work:

Code: Select all

set the hideconsolewindows to true
put "taskkill /f /im" && quote & "processname.exe" & quote into tShell
get shell (tShell)
Bear in mind that it's dangerous and quite probably undesired, and certainly bad practice to kill a process without user intervention. Are you sure that it's a safe tool?

shadowslash
Posts: 344
Joined: Tue Feb 24, 2009 6:14 pm
Contact:

Post by shadowslash » Thu Mar 05, 2009 9:26 pm

wow! thank you so much! "day maker" ^^ but i'm currently in my friend's pc and i think he's running under Windows XP Home Edition and the TaskKill.exe is not part of the cmd functionalities by default.. good thing i have taskkill.exe with me in my usb storage device ^^ but the code still wont work so i modified it a bit and got what i wanted...

here's the new code i edited:

Code: Select all

on mouseUp
   local tShell
   set the hideconsolewindows to true
   put "C:\WINDOWS\System32\taskkill /f /im" && quote & "notepad.exe" & quote into tShell
   get shell (tShell)
   answer it
end mouseUp
Parañaque, Philippines
Image
Image

Post Reply