Determine if Process is stuck at "starting"

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
MrShortcut
Posts: 7
Joined: 24 May 2011 17:48

Determine if Process is stuck at "starting"

#1 Post by MrShortcut » 29 May 2011 22:05

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?

orange_batch
Expert
Posts: 442
Joined: 01 Aug 2010 17:13
Location: Canadian Pacific
Contact:

Re: Determine if Process is stuck at "starting"

#2 Post by orange_batch » 29 May 2011 23:57

Have you tried tasklist or WMI (either wmic or vbscript)?

MrShortcut
Posts: 7
Joined: 24 May 2011 17:48

Re: Determine if Process is stuck at "starting"

#3 Post by MrShortcut » 30 May 2011 10:33

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"

orange_batch
Expert
Posts: 442
Joined: 01 Aug 2010 17:13
Location: Canadian Pacific
Contact:

Re: Determine if Process is stuck at "starting"

#4 Post by orange_batch » 30 May 2011 12:36

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.

Cleptography
Posts: 287
Joined: 16 Mar 2011 19:17
Location: scriptingpros.com
Contact:

Re: Determine if Process is stuck at "starting"

#5 Post by Cleptography » 30 May 2011 12:41

@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?

orange_batch
Expert
Posts: 442
Joined: 01 Aug 2010 17:13
Location: Canadian Pacific
Contact:

Re: Determine if Process is stuck at "starting"

#6 Post by orange_batch » 30 May 2011 14:15

Do you mean me? :P WMI is native to XP Home (and all Windows since Windows 2000). WMIC is not.

Cleptography
Posts: 287
Joined: 16 Mar 2011 19:17
Location: scriptingpros.com
Contact:

Re: Determine if Process is stuck at "starting"

#7 Post by Cleptography » 30 May 2011 14:29

@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:

orange_batch
Expert
Posts: 442
Joined: 01 Aug 2010 17:13
Location: Canadian Pacific
Contact:

Re: Determine if Process is stuck at "starting"

#8 Post by orange_batch » 30 May 2011 15:04

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!

Ed Dyreen
Expert
Posts: 1569
Joined: 16 May 2011 08:21
Location: Flanders(Belgium)
Contact:

Re: Determine if Process is stuck at "starting"

#9 Post by Ed Dyreen » 30 May 2011 22:20

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 ?

Cleptography
Posts: 287
Joined: 16 Mar 2011 19:17
Location: scriptingpros.com
Contact:

Re: Determine if Process is stuck at "starting"

#10 Post by Cleptography » 30 May 2011 22:42

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.

Post Reply