Announcement

Collapse
No announcement yet.

ProcessWatcher

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • ProcessWatcher

    Thought I would start this

    I ran it and got this error--8/15/2006 5:46:47 PM ~!~Info~!~Running script in background: ProcessWatcher.vb
    8/15/2006 5:46:57 PM ~!~PROC.STATUS~!~Error in Trace = Cannot create ActiveX component.
    8/15/2006 5:46:57 PM ~!~PROC.STATUS~!~found = False
    8/15/2006 5:46:59 PM ~!~PROC.STATUS~!~Error in Trace = Cannot create ActiveX component.
    8/15/2006 5:46:59 PM ~!~PROC.STATUS~!~C:\Program Files\HomeSeer 2\Speaker.exe could not be started due to error, rc = 0

    Thanx
    Tim

    ps Here is my mods
    PHP Code:
    Sub Main(parm as object)
            
    Dim targetName As String "Speaker.exe" ' line 18
            Dim targetPath As String = "C:\Program Files\HomeSeer 2\"
        Dim strComputer As String = "andrew" ' 
    hostname of target computer use "." for local computer 
    FB Page - https://www.facebook.com/pages/Capt-Tim/209398425902188

    HSTouch Layouts - https://www.facebook.com/media/set/?...5902188&type=3

    No, Im from Iowa. I only work in outer space. Captain Kirk

  • #2
    So, you got the errors after your mod?

    I was able to run this OK with your mods. But, I did notice that the Exists function needs to be case insensitive in the compare statement. I'll mod this & post the new version.

    I have seen the errors that you posted when permissions on the target box wouldn't allow WMI remote starts. For example, I can run this agains two 2003 servers on my system. But, when I run it against an XP box I get the errors that you posted. I'll look into the XP policies & see what I can find.

    Thanks,

    Bob
    Last edited by cactsbob; August 16th, 2006, 08:31 AM.

    Comment


    • #3
      It looks like the ActiveX components have to be explicitly allowed under XP. I found this url with some information.

      http://www.microsoft.com/technet/pro.../rstrplcy.mspx

      Comment


      • #4
        I recently moved Homeseer to a new box. I got the above errors until I ran the process watcher script under a userid that had permissions to run remote wmi.

        I am running HS as a service. So, I changed the service to run under a userid that had remote wmi permissions & everything worked ok.

        Comment


        • #5
          Commenting out lines in this script

          Hi Bob,

          I recently set up this script to keep an eye on my VWS program. It works great, Thanks!

          I did run into a problem when I tried to comment out some of the process information that is displayed in the HSLog if "Found = True" (just trying to clean up the log a bit). The following lines can be commented out by using a single quote mark:
          Code:
              hs.WriteLog("PROC", "Process: " & objProcess.Name)
              hs.WriteLog("PROC.STATUS", "Process ID: " & objProcess.ProcessID)
              hs.WriteLog("PROC.STATUS", "Thread Count: " & objProcess.ThreadCount)
          However, when I get to the lines that contain the underscore symbol preceding the variable name:
          Code:
              hs.WriteLog("PROC.STATUS", "Page File Size: " _
               & objProcess.PageFileUsage)
              hs.WriteLog("PROC.STATUS", "Page Faults: " _
               & objProcess.PageFaults)
              hs.WriteLog("PROC.STATUS", "Working Set Size: " _
               & objProcess.WorkingSetSize)
          I receive an error from HS of
          Code:
          7/10/2007 12:18:26 PM ~!~Error~!~Script compile error: Syntax error.on line 93
          7/10/2007 12:18:26 PM ~!~SCR~!~Option Strict Offimports Schedulerimports SystemPublic Module scriptcode3#Region "Automatically generated code, do not modify"'Automatically generated code, do not modify'
          "

          Why am I not able to comment out the lines that have the underscore symbol in them? I am able to delete these lines from the script, and keep the process information from showing in the HSLog, with no error message. However, as a newbie to vbscripting, I would like to understand why I get the error message.

          Thanks,
          Jerry
          Last edited by Jerry S; July 10th, 2007, 12:25 PM. Reason: Added additional error message

          Comment


          • #6
            Looking at this http://www.microsoft.com/technet/scr....mspx?mfr=true the above code looks correct.

            What is on line 93 and what is the full error message (the whole of the second line in the log error)?

            The lines with the underscore symbol are continued statements. You have to delete the line and any further continuation lines (that end in the continuation character of underscore) below them, including the last one without a continuation symbol, to avoid a syntax error.

            Comment


            • #7
              Hi Fuego,

              Thanks for the nudge in the right direction. I removed the underscores from the statements, along with the spaces and tabs that followed the underscores, tried to comment out the lines with a single quote, and all works well.

              I'll do a little learning on the website you mentioned, and hopefully have less of these beginner questions as time passes.

              Thanks again,
              Jerry

              Comment

              Working...
              X