Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Application Title

Status
Not open for further replies.

Cilverphox

Programmer
Jan 3, 2005
4
US
Alright,

I'm configuring HP t5720 Thin Clients (WinXPe) to operate like Kiosks. You should know that these thin clients CANNOT use WMI - which has made my life VERY difficult.

Without using WMI, how can I retrieve a list of or number of open applications. Thanks in advance

-Cilverphox
 
You may want to try AutoIT It has a function called ProcessList that returns an array. You can package it into an .exe so autoit does not have to be installed on the machine you run it on.

--------------------------------------------------------------------------------
dm4ever
My philosophy: K.I.S.S - Keep It Simple Stupid
 
Thanks dm4ever for the suggestion. I'll look into it.

This is what I ended up doing...it was a pain in my forehead.

I stored the output of a tasklist.exe with highly unique argument list to an object. I then traveresed the object and through a series of MIDs and TRIMS and INSTRs I extract the task name and PID. I then compared the task name with an array of tasks that I did not want to close. If the task name != a reserved task name then AppActivate(PID) and sendkeys("%{F4}").

What a F***** up way of ending a process...

HP! you better get your s*** together and allow WMI on your Thin Clients!! I can spend hours writing a workaround for 3 line vlock of WMI code!!!

:)

Day's done, I'm going home

-Cilverphox
 
Thanks for posting back what you went with. I had never looked at that tasklist.exe. Looking at the options for tasklist, you may be able to refine the command even more. Here is a way to get that information without any trims, mids, etc.

Code:
Option Explicit
'On Error Resume Next

Dim objShell, objExec, strOutput, arrTemp1, arrTemp2, i

Set objShell = CreateObject("WScript.Shell")
Set objExec = objShell.Exec("tasklist.exe /NH /FO ""csv""")
strOutput = Replace(objExec.StdOut.ReadAll, Chr(34), "")
arrTemp1 = Split(strOutput, VbCrLf)
For i = 1 To UBound(arrTemp1) - 1
	arrTemp2 = Split(arrTemp1(i), ",")
	WScript.Echo "Process Name: " & arrTemp2(0)
	WScript.Echo "Process ID: " & arrTemp2(1)
Next

--------------------------------------------------------------------------------
dm4ever
My philosophy: K.I.S.S - Keep It Simple Stupid
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top