Wilders Security Forums  

Go Back   Wilders Security Forums > Archived Forums > Closed Sub-Forums > Archive of DiamondCS Support Forums > DCS Freeware
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread
  #1  
Old December 1st, 2006, 10:40 AM
googlymoogly googlymoogly is offline
Infrequent Poster
 
Join Date: Dec 2006
Posts: 1
Default CmdLine Request/"Bug"

Or rather, unwanted behaviour.

I wanted to use the most excellent tool CmdLine in a scheduled script that checks whether a certain process is running, and if not, then restart it. Due to several technical reasons, running them as services isn't advisable.

So, anyway... this is my script:

Code:
dim apa set oShell = createobject("wscript.shell") mystr = "cmdline | find ""[PATH_TO_EXECUTABLE]"" /i" set apa = oShell.exec("%comspec% /c """ & mystr & """") if apa.stdout.readall = "" then DO STUFF else DON'T DO STUFF end if

cmdline always returns a line though, because, well... the piped find command is "running", see.

You can even do

Code:
cmdline | find "asgojiesiosaegj" /i
and it'll return

find "asgojiesiosaegj" /i

I suggest a switch for CmdLine that would ignore this type of thing, if possible.

Thanks!

[Edit]
Actually, I found a solution by doing
find "BLABLA" /i /c, and then checking for > 1.
So this thread is kind of pointless I guess! I'll blame a long work day.
 

Wilders Security Forums > Archived Forums > Closed Sub-Forums > Archive of DiamondCS Support Forums > DCS Freeware « Previous Thread | Next Thread »

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Settings
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -4. The time now is 04:33 AM.


Powered by vBulletin® Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Copyright ©2002 - 2013, Wilders Security Forums