VB runtime error in Windows 2008R2


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 1 of 1

Thread: VB runtime error in Windows 2008R2

Hybrid View

  1. #1
    Join Date
    Jan 2006
    Posts
    1

    VB runtime error in Windows 2008R2

    We have number of .bat and VB scripts for monitoring SQL servers. The scripts are running fine on all previous Windows versions. Now we migrated one of the servers to Window 2008 R2 and a VB script is getting “Microsoft VBScript Runtime Error: Permission Denied”. I’m getting it on the line ‘oCluster.Open ComputerName’. I logged in to the box with my domain account which is a member of the local admin group. Does anybody know how to fix this issue? Where should I set permissions in Win 2008R2?

    Many thanks in advance!
    Code:
    '#######################################
    Option Explicit
    ' Declare the constants and variables. Setting ComputerName
    ' to an empty string prompts the script to connect to the
    ' local computer.
    Const ComputerName = ""
    Const ForWriting = 2
    Const StateFile = "c:\UsrBin\Server_Checks\clusterstate.log"
    Dim oFs, f, oCluster, res, resGroup
    
    ' Set the FileSystemObject object.
    Set oFs = CreateObject("Scripting.FileSystemObject")
    ' Create a new text file to store the ownership information.
    Set f = oFs.CreateTextFile(StateFile,ForWriting)
    
    ' Set the Cluster Automation Server object.
    Set oCluster = CreateObject("MSCluster.Cluster")
    
    ' Open a connection to the cluster node.
    oCluster.Open ComputerName
    
    ' For each resource in the cluster node, get each resource
    ' group's resources.
    For Each res in oCluster.Nodes
      ' For each resource group, get the name and the owner. Write
      ' this information to the text file.
      For Each resGroup in res.ResourceGroups
        f.writeline resGroup.name & "," & resGroup.OwnerNode.Name
      Next
    Next
    
    ' Close the text file.
    f.Close
    
    ' Release memory.
    Set oCluster = nothing
    Set f = nothing
    Set oFs = nothing
    '######################################
    Last edited by Hack; 07-29-2013 at 07:22 AM. Reason: Added Code Tags

Similar Threads

  1. Replies: 2
    Last Post: 01-14-2009, 08:50 AM
  2. Runtime error '48' Error loading dll Windows XP Home
    By adstheman in forum VB Classic
    Replies: 30
    Last Post: 11-12-2008, 03:22 AM
  3. Replies: 3
    Last Post: 03-27-2002, 01:48 PM
  4. Runtime error 6160, data access error.
    By Pat in forum VB Classic
    Replies: 2
    Last Post: 01-29-2002, 03:18 AM
  5. Runtime error '430' on windows NT
    By Milper Bolodo in forum VB Classic
    Replies: 1
    Last Post: 07-13-2001, 07:48 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center