Help with Scripting Needed Desperately

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Joe Foran

    Help with Scripting Needed Desperately

    Hi everyone,

    I'm in a bit of a bind... I have some batch scripting ability but next
    to no skill in VBS. I had a set of scripts that would:

    Query the registry key
    HKLM\SOFTWARE\M icrosoft\SMS\Cl ient\Configurat ion\Client Application
    Launchers\Hardw are Inventory Agent

    If the value returned is 0x79726f74 then it would stop the SMS Client
    Service (clisvc), wait for this to complete, and then delete two
    registry keys:

    HKLM\SOFTWARE\M icrosoft\SMS\Cl ient\Configurat ion\Client Application
    Launchers\Hardw are Inventory Agent

    HKLM\SOFTWARE\M icrosoft\SMS\Cl ient\Client Components\Hard ware
    Inventory Agent

    5. Report back to a file on \\hostserver\MS KB\28552\

    We also had a VBS that ran great, but required WMI 1.5. Thus comes the
    caveat... the targets are our legacy desktops running NT4 Workstation,
    WMI v1, and IE5. The script needs to run at logon (we use psexec to
    get elevated rights), and definately has to report back for auditing
    purposes.

    Does anyone know how to do this? I am completely tapped.


    TIA!

    Joe Foran


  • mayayana

    #2
    Re: Help with Scripting Needed Desperately

    You don't need WMI to read a key/value and/or delete
    a key/value. You can use WScript.Shell object's RegRead
    and RegDelete.
    If you want sample code:

    WScript.Shell samples:


    A package of VBS classes, one of which is for Registry functions:


    I don't know about "reporting back" to a remote file.
    If you mean write to a file you can use the FileSystemObjec t's
    Textstream object, but I don't know the syntax for that in
    dealing with a remote file.

    This is a VB group, though, not VBS. You might try
    microsoft.publi c.scripting.vbs cript
    microsoft.publi c.scripting.wsh
    if you need more help.
    --[color=blue]
    >
    > I'm in a bit of a bind... I have some batch scripting ability but next
    > to no skill in VBS. I had a set of scripts that would:
    >
    > Query the registry key
    > HKLM\SOFTWARE\M icrosoft\SMS\Cl ient\Configurat ion\Client Application
    > Launchers\Hardw are Inventory Agent
    >
    > If the value returned is 0x79726f74 then it would stop the SMS Client
    > Service (clisvc), wait for this to complete, and then delete two
    > registry keys:
    >
    > HKLM\SOFTWARE\M icrosoft\SMS\Cl ient\Configurat ion\Client Application
    > Launchers\Hardw are Inventory Agent
    >
    > HKLM\SOFTWARE\M icrosoft\SMS\Cl ient\Client Components\Hard ware
    > Inventory Agent
    >
    > 5. Report back to a file on \\hostserver\MS KB\28552\
    >
    > We also had a VBS that ran great, but required WMI 1.5. Thus comes the
    > caveat... the targets are our legacy desktops running NT4 Workstation,
    > WMI v1, and IE5. The script needs to run at logon (we use psexec to
    > get elevated rights), and definately has to report back for auditing
    > purposes.
    >
    > Does anyone know how to do this? I am completely tapped.
    >
    >
    > TIA!
    >
    > Joe Foran
    >
    >[/color]


    Comment

    Working...