How can I use VB Code to show Window Task Manager? Thanks.
Printable View
How can I use VB Code to show Window Task Manager? Thanks.
:)VB Code:
Option Explicit Private Sub Command1_Click() Shell "taskmgr.exe", vbNormalFocus End Sub
When you have received an answer to your question, please mark it as Resolved using the Thread Tools menu.http://www.vbforums.com/images/ieimages/2004/12/1.gif
I do not have privilege to show Windows Task manager(lock my administrator). But sometime my computer got stuck so I want to end process some applications. Is there any API function to do show Windows Task Manager? Thanks.
You can write code to terminate a process without using taskmanager. Search for "Terminate + Process" on the forums. I have some code as well as others.
VB Code:
Private Sub Command1_Click() TerminateProcess ("WINWORD.EXE") End Sub Private Sub TerminateProcess(app_exe As String) Dim Process As Variant For Each Process In GetObject("winmgmts:").ExecQuery("Select Name from Win32_Process Where Name = '" & app_exe & "'") Process.Terminate Next End Sub
But if his system is locked down then odds are that WMI is also disabled. ;)
True ... then he shouldnt be messing with it ;)
True but only after we know the truth. :D
also open a command prompt and type
taskkill /?
for the help on how to use taskkill, usualy something like
TASKKILL /f /im Progname.exe
dont konw if youll have the privs for this either, but worth a try :)
sorry,
in my above it is of course a shell command eg
SHELL("TASKKILL /f /im Progname.exe")
dont for get to put double quotes arround the bits in the brakets, or put this string into a variable (you send a string to the SHELL)