Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.
Keywords: remote application process exists running
The following 'performance counter string' allows you grab the process ID of a Process.
\\TestMachine\Process(popmenu)\ID ProcessIf that process doesn't exist, the tGetData function would throw a 225 Error, which would indicate the process doesn't exist.
;Addextender("wproc34i.dll") Addextender("wwprc44i.dll") computername = "\\TestMachine" procname = "popmenu" counterstring = StrCat(computername,"\Process(",procname,")\ID Process") ;Connects to the remote machine ErrorMode(@Off) ret = tRemoteConn(computername) ErrorMode(@Cancel) if ret==0 Message(StrCat("Unable to connect to ",computername),StrCat("For the following reason:",@CRLF,"Extender Error ",LastError(),@CRLF,tGetLastError())) exit endif ;Message("tBrowseCntrs returned full counter path",counterstring) ErrorMode(@Off) dat=tGetData(counterstring,0) ErrorMode(@Cancel) ;capture possible error 225, if process doesnt exist if LastError()==225 Message(procname, "Does NOT Exist") else Message(procname, "Exists") endif exit
Article ID: W15076
File Created: 2013:04:01:09:08:20
Last Updated: 2013:04:01:09:08:20