1. Welcome Guest! In order to create a new topic or reply to an existing one, you must register first. It is easy and free. Click here to sign up now!.
    Dismiss Notice

Re: Use VBScript to Set Local Computer Description

Discussion in 'Windows Vista' started by Jeremy, Jun 5, 2009.

  1. Jeremy

    Jeremy Guest

    Short update, seems that it doesn't work in Server 2008 with SP2 which I
    just installed on a server either.


    "Jeremy" <trombone79atgmail.com> wrote in message
    news:OjxTslzyJHA.1416@TK2MSFTNGP04.phx.gbl...
    >I have been doing this for years in XP and Server 2003, but recently I have
    >been installing Vista x64 Edition for some specific needs. This code is
    >part of a workstation startup script that pulls the description from AD and
    >makes it the local description on the computer. This does not work in
    >Vista x64 or Server 2008 x64 and I have found no explanation on the
    >Internet as of yet. I have not tested in x86 installs of the same OS.
    >Yes, I am running it as administrator while testing, if I do not, I receive
    >Access Denied.
    >
    >
    > sComputer = "."
    > Set Obj = GetObject("winmgmts:\\" & sComputer &
    > "\root\cimv2").InstancesOf("Win32_OperatingSystem")
    > For Each x In Obj
    > x.Description = "This is the computer description."
    > x.Put_
    > Next
    >
    >
    > The object is being created just fine. I can use other methods on the
    > object successfully like GetText_ . I have found no documentation that
    > says Put_ shouldn't work.
    > Any help would be appreciated. This one is driving me crazy.
    >
    > When running, I receive the following error:
    > ---------------------------
    > Windows Script Host
    > ---------------------------
    > Script: C:\Users\username\Desktop\test.vbs
    > Line: 6
    > Char: 4
    > Error: Value out of range
    > Code: 8004102B
    > Source: SWbemObjectEx
    >
    > ---------------------------
    > OK
    > ---------------------------
    >
    > Thanks
    >
     

Share This Page