OT: How does Windows handle spaces in program names?

Ken Ray kray at sonsothunder.com
Sun May 22 14:04:36 EDT 2011



> It would be helpful of course if I could see the process list in the PC - then
> I could launch the prog from outside my LC app and just look at the list to
> see what Windows calls it, but I don't know how to do that on XP since
> 'tasklist' isn't recognised and I don't know how to display things from a VB
> script. It's sad to be so ignorant, but the charm of LiveCode is that you
> don't normally have to know this kind of stuff about your target OS.

Here you go - this is a VBScript that will do it (watch line wraps):

Set ProcessSet = 
GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\cimv2").ExecQu
ery("Select * from Win32_Process")

tList = ""
For each Process in ProcessSet
    if Process.ExecutablePath <> "" Then
        tList = tList & "Process.Name" & vbcrlf
    End If
Next
WScript.Echo tList

Ken Ray
Sons of Thunder Software, Inc.
Email: kray at sonsothunder.com
Web Site: http://www.sonsothunder.com/






More information about the use-livecode mailing list