CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 1 of 1
  1. #1
    Join Date
    Apr 2008
    Location
    Indore,India
    Posts
    1

    SWbemLocator error '800706ba' The RPC server is unavailable.

    Hello All,

    I am trying to run a wav file on a remote machine(Let's say A). For this I have created a batch file on A, which runs wave file. Now I am trying to schedule a task on A using VBScript. But I am getting this error:

    SWbemLocator error '800706ba'
    The RPC server is unavailable.

    Following is my code

    Code:
    strComputer = A_IP_ADD
    Set objSWbemLocator = Server.CreateObject("WbemScripting.SWbemLocator")
    Response.Write("<br> objSWbemLocator Created")
    
    Set objSWbemServices = objSWbemLocator.ConnectServer _        
            (strComputer, "root\cimv2", DOMAIN\USEERNAME, PASSWORD)
    Response.Write("<br> objSWbemServices Created")
    
    objSWbemServices.Security_.impersonationlevel = 3
    objSWbemServices.Security_.AuthenticationLevel  = 6
    Response.Write("<br> Impersonation level set")
    
    Set objNewJob = objSWbemServices.Get("Win32_ScheduledJob")
    Const JobID = "Play_Sound"
    errJobCreated = objNewJob.Create _
            (BATCH_FILE_PATH, "********072000.000000-420", _
                False , , , , JobID) 
    Response.Write("<br> JOB CREATED: "& errJobCreated)
    I am able to login to A through VNC using same user name and password that I am using in this code.

    Please help me out with this. Thanks in advance.
    Last edited by PeejAvery; April 8th, 2009 at 02:53 PM. Reason: Added code tags.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured