This shows you the differences between two versions of the page.
— |
gemus_script_reference:functions:kill_process [2020/05/12 11:26] (current) Jimbo created |
||
---|---|---|---|
Line 1: | Line 1: | ||
+ | Back to [[.:|Script Function Reference]] | ||
+ | ====== Kill_Process() ====== | ||
+ | |||
+ | The Kill_Process() function kills all running processes matching the specified filename. | ||
+ | |||
+ | ===== Syntax ===== | ||
+ | |||
+ | <code>Kill_Process(filename)</code> | ||
+ | |||
+ | ===== Arguments ===== | ||
+ | |||
+ | ^ Argument ^ Required ^ Description ^ | ||
+ | | //filename// | Yes | The filename of the process(es) you want to kill. If //filename// contains a backslash character ( //\// ) then it is expected to be a full absolute path\filename (e.g. c:\windows\notepad.exe). Any [[..:environment_variables|script environment variables]] found in //filename// will be replaced by their actual values when the script is executed. | | ||
+ | \\ | ||
+ | |||
+ | ===== Examples ===== | ||
+ | |||
+ | <code> | ||
+ | Kill_Process(notepad.exe) | ||
+ | </code> | ||
+ | This kills any running process who's path-less filename is "notepad.exe" | ||
+ | |||
+ | <code> | ||
+ | Kill_Process(c:\windows\notepad.exe) | ||
+ | </code> | ||
+ | This kills any running process who's absolute full path\filename is "c:\windows\notepad.exe" | ||
+ | |||
+ | <code> | ||
+ | Kill_Process(%dbpath%\Joy2Key\JoyToKey.exe) | ||
+ | </code> | ||
+ | This kills the running process JoyToKey.exe if it was started from "%dbpath%\Joy2Key\" | ||
+ | |||
+ | ===== Remarks ===== | ||
+ | |||
+ | * Use this function with care: It will immediately and relentlessly TERMINATE all matching running processes, so be careful what you pass this function as an argument! | ||
+ | * This function is Windows XP/Vista/7 only. It does not support 9x. It also has not been tested on 64-bit versions. | ||
+ | |||
+ | ===== See Also ===== | ||
+ | |||
+ | * [[.:run_program|Run_Program()]] | ||
+ | * [[.:|Script Function Reference]] |