• XP Script NG on Vista (Vista)

    Author
    Topic
    #448498

    Under Windows XP I invoked Cscript.exe passing it the script shown below to deactivate Outlook.
    Dim oAppOL
    set oAppOL = GetObject(, “Outlook.Application”)
    oAppOL.Quit
    set oAppOL = Nothing

    It worked fine. Doing the same thing under Vista produces the following error: “Microsoft VBScript runtime error: ActiveX component can’t create object: ‘GetObject'”. I don’t know the script language; I copied it from a magazine. Can anyone tell me how to correct whatever is wrong?

    John Littell

    Viewing 0 reply threads
    Author
    Replies
    • #1097052

      You can’t use GetObject function; use CreateObject instead.
      Change the second line in your script like this:

      set oAppOL = CreateObject(“Outlook.Application”)

      • #1097060

        Changed the statuement as per your instructions.

        Worked perfectly.

        Thank you, John

    Viewing 0 reply threads
    Reply To: XP Script NG on Vista (Vista)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: