Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. Help with vbscript and Windows NT

Help with vbscript and Windows NT

Scheduled Pinned Locked Moved Visual Basic
helpasp-nettoolsquestioncareer
7 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • I Offline
    I Offline
    Its due when
    wrote on last edited by
    #1

    Hi Guys, Well I'm totally stumped. I've got a bit of vbscript code that tries to find a particular process running on a machine (Windows NT). If the process exists I want the text ("I am running...") displayed. If it doesn't exist then I want the text ("I am not running") displayed. Just some background on the OS. Its Win NT 4 service pack 6 and i reinstalled WMI Core 1.5 On win xp, win 2k and win 2k3 the script below works fine. However on windows nt where this will reside on it fails giving me an error 80041001 which I belive is a "Call failed" error. Can anyone shed some light on why this would be happening on NT in particular? Thanks in advance <% Dim strComputer, strProcess strComputer = "." On Error Resume Next Set objWMIService = GetObject("winmgmts:" _ & "{impersonationLevel=impersonate}!­ \\" _ & strComputer & "\root\cimv2") Set colProcess = objWMIService.ExecQuery _ ("Select * from Win32_Process") For Each objProcess in colProcess do while objProcess.name = "Someprocess.exe" strProcess = objProcess.name 'objProcess.Name 'If objProcess.name = "Someprocess.exe" then Response.Write ("I am running...") 'Else 'End If Exit Do Loop Next If strProcess = "" then Response.Write ("I am NOT running") End If %>

    D 1 Reply Last reply
    0
    • I Its due when

      Hi Guys, Well I'm totally stumped. I've got a bit of vbscript code that tries to find a particular process running on a machine (Windows NT). If the process exists I want the text ("I am running...") displayed. If it doesn't exist then I want the text ("I am not running") displayed. Just some background on the OS. Its Win NT 4 service pack 6 and i reinstalled WMI Core 1.5 On win xp, win 2k and win 2k3 the script below works fine. However on windows nt where this will reside on it fails giving me an error 80041001 which I belive is a "Call failed" error. Can anyone shed some light on why this would be happening on NT in particular? Thanks in advance <% Dim strComputer, strProcess strComputer = "." On Error Resume Next Set objWMIService = GetObject("winmgmts:" _ & "{impersonationLevel=impersonate}!­ \\" _ & strComputer & "\root\cimv2") Set colProcess = objWMIService.ExecQuery _ ("Select * from Win32_Process") For Each objProcess in colProcess do while objProcess.name = "Someprocess.exe" strProcess = objProcess.name 'objProcess.Name 'If objProcess.name = "Someprocess.exe" then Response.Write ("I am running...") 'Else 'End If Exit Do Loop Next If strProcess = "" then Response.Write ("I am NOT running") End If %>

      D Offline
      D Offline
      Dave Kreskowiak
      wrote on last edited by
      #2

      Does the account the this script is running under have at least PowerUser permissions to the machine you're monitoring? RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome

      I 1 Reply Last reply
      0
      • D Dave Kreskowiak

        Does the account the this script is running under have at least PowerUser permissions to the machine you're monitoring? RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome

        I Offline
        I Offline
        Its due when
        wrote on last edited by
        #3

        How do I set the permissions for users in Windows NT? The interface is not what Im used to and Im not sure how I can change it. Thanks

        D 1 Reply Last reply
        0
        • I Its due when

          How do I set the permissions for users in Windows NT? The interface is not what Im used to and Im not sure how I can change it. Thanks

          D Offline
          D Offline
          Dave Kreskowiak
          wrote on last edited by
          #4

          What user account is this script running under??? Is this script in a web page?? Does the script run on the server or on the client side?? Are you running it by double-clicking a *.VBS file?? RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome

          I 1 Reply Last reply
          0
          • D Dave Kreskowiak

            What user account is this script running under??? Is this script in a web page?? Does the script run on the server or on the client side?? Are you running it by double-clicking a *.VBS file?? RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome

            I Offline
            I Offline
            Its due when
            wrote on last edited by
            #5

            The script is in a webpage and runs on the server. How do I determine which account is running that script. I would have though it would have been the IUSR_xxxxxxxx account or am I wrong?

            D 1 Reply Last reply
            0
            • I Its due when

              The script is in a webpage and runs on the server. How do I determine which account is running that script. I would have though it would have been the IUSR_xxxxxxxx account or am I wrong?

              D Offline
              D Offline
              Dave Kreskowiak
              wrote on last edited by
              #6

              It'll be that account and, No, it doesn't have sufficient rights to do what you want. Add that account to the Power Users group and it'll get the rights it needs. BUT!!! BEWARE!!! This ia a HUGE security risk if your NT server is visible to the Internet. RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome

              I 1 Reply Last reply
              0
              • D Dave Kreskowiak

                It'll be that account and, No, it doesn't have sufficient rights to do what you want. Add that account to the Power Users group and it'll get the rights it needs. BUT!!! BEWARE!!! This ia a HUGE security risk if your NT server is visible to the Internet. RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome

                I Offline
                I Offline
                Its due when
                wrote on last edited by
                #7

                Where do you actually setup the permissions for accounts in Windows NT?

                1 Reply Last reply
                0
                Reply
                • Reply as topic
                Log in to reply
                • Oldest to Newest
                • Newest to Oldest
                • Most Votes


                • Login

                • Don't have an account? Register

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • World
                • Users
                • Groups