Page 1 of 1

Determine if Process is stuck at "starting"

Posted: 29 May 2011 22:05
by MrShortcut
I have a batch that uses the following code to query the JDATSP process which has been useful in finding out when the process is stopped. However I have been finding that sometimes the results show the process is "Running" when the process is stuck at "starting" according to services.msc.

Code: Select all

sc.exe \\10.11.2.34 query JDATSP


Is there a way to get a more exact result so I could see if it is at starting?

Re: Determine if Process is stuck at "starting"

Posted: 29 May 2011 23:57
by orange_batch
Have you tried tasklist or WMI (either wmic or vbscript)?

Re: Determine if Process is stuck at "starting"

Posted: 30 May 2011 10:33
by MrShortcut
I wasn't aware of those options. I was able to use the tasklist using the following (just need to find one stuck at starting to see if it records accurately) but cant quite figure out how to use the WMIC feature correctly.

Code: Select all

tasklist /s 10.11.2.34 /v /fi "SERVICES eq JDATSP"

Re: Determine if Process is stuck at "starting"

Posted: 30 May 2011 12:36
by orange_batch
WMI is a language of it's own, but it is fairly easy. It is THE KING of retrieving system information. In 11 lines of vbscript (3 of which are syntax), I was able to program a WMI tasklister more powerful than tasklist itself lol.

Anyhow, it seems tasklist is sufficient for your needs. Be aware that it is unavailable on Windows XP Home.

Re: Determine if Process is stuck at "starting"

Posted: 30 May 2011 12:41
by Cleptography
@nitt
I do not understand if you are going to go down the road of wmi which correctly is not native to xp home why not just download pshell?

Re: Determine if Process is stuck at "starting"

Posted: 30 May 2011 14:15
by orange_batch
Do you mean me? :P WMI is native to XP Home (and all Windows since Windows 2000). WMIC is not.

Re: Determine if Process is stuck at "starting"

Posted: 30 May 2011 14:29
by Cleptography
@orange
I know wmi is not native to xp home. I was asking if you were going to go down that road why not just download and install pshell.
:roll:

Re: Determine if Process is stuck at "starting"

Posted: 30 May 2011 15:04
by orange_batch
Haha no no, did you misread or typo? WMI IS native to XP Home. It's the WMIC command line utility that is not. VBScripts for WMI work fine.

Why not Pshell? Simply because the user would have to install it!

Re: Determine if Process is stuck at "starting"

Posted: 30 May 2011 22:20
by Ed Dyreen
Anyone who uses an undressed version of windows, should not do much more than clicking the mouse &spending money on legal software! After all why is it undressed, it's all for the money...

How important is tasklist not to put it in there, ridiculous. Like or people won't download it shhh.

Thinking about it, why would I buy software at all, takes me more effort to get it legally and many freeware is actiually better.

Take 7zip free for use however, WinACE gadde pay however, 7zip is better ???
Where is the logic in that ?

Re: Determine if Process is stuck at "starting"

Posted: 30 May 2011 22:42
by Cleptography
orange_batch wrote:Haha no no, did you misread or typo? WMI

Typo :oops:

@Ed
I have not ever actually used WinAce, but I like 7zip especially its command line options. Anything with command line options is all good to me.