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

how to install a simple fix script to a dozen computers using psexec

Discussion in 'Windows Home Server' started by Zsolt Ero, Oct 19, 2009.

  1. Zsolt Ero

    Zsolt Ero Guest

    I am just trying how to use psexec, but I still don't understand how
    does it work on local accounts and how can I modify HKLU values in
    registry.

    I would like to run a simple fix .bat file on computers in a local
    workgroup, the script would modify some values in HKLU, copy some
    files, etc., with no GUI.

    I am puzzled by the HKLU part. As far as I understand I can either get
    the SID of the user using psgetsid and change the reg file not to use
    HKLU but find the proper value in HKEY_USER\SID... but I don't know
    how to do it.

    My other idea is to let a batch script run on startup for all users.
    This way I don't have to take care about different SID values. How
    would you make a simple \\server\share\batchfile.bat run for every
    user on startup? And copy a .lnk file into the All Users\Start Menu
    \Starup directory? Or to modify the autostart registry?

    I could figure out things to this point, but I cannot go further.
    Where shell I set autoruns for all users? Do you think this one would
    work?

    psexec \\server -u administrator -p password regedit /s \\server\share
    \fix_startup.reg

    ----- fix_startup.reg
    Windows Registry Editor Version 5.00

    [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run]
    "fix"="\\server\share\fix.bat"
    -----

    Is there any way to start that bat file in a specified working dir
    from the registry, e.g. in "\\server\share\" ?
     
  2. Zsolt Ero

    Zsolt Ero Guest

    Re: how to install a simple fix script to a dozen computers usingpsexec

    Sorry, two fixes, HKLU -> HKCU.
    I realized psgetsid is for totally different purposes, I was looking
    for HK_USERS\S-1-5... string.


    On Oct 20, 3:10 am, Zsolt Ero <zsolt....@gmail.com> wrote:<!--coloro:blue--><span style="color:blue <!--/coloro-->
    > I am just trying how to use psexec, but I still don't understand how
    > does it work on local accounts and how can I modify HKLU values in
    > registry.
    >
    > I would like to run a simple fix .bat file on computers in a local
    > workgroup, the script would modify some values in HKLU, copy some
    > files, etc., with no GUI.
    >
    > I am puzzled by the HKLU part. As far as I understand I can either get
    > the SID of the user using psgetsid and change the reg file not to use
    > HKLU but find the proper value in HKEY_USERSID... but I don't know
    > how to do it.
    >
    > My other idea is to let a batch script run on startup for all users.
    > This way I don't have to take care about different SID values. How
    > would you make a simple \serversharebatchfile.bat run for every
    > user on startup? And copy a .lnk file into the All UsersStart Menu
    > Starup directory? Or to modify the autostart registry?
    >
    > I could figure out things to this point, but I cannot go further.
    > Where shell I set autoruns for all users? Do you think this one would
    > work?
    >
    > psexec \server -u administrator -p password regedit /s \servershare
    > fix_startup.reg
    >
    > ----- fix_startup.reg
    > Windows Registry Editor Version 5.00
    >
    > [HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionRun]
    > "fix"="\serversharefix.bat"
    > -----
    >
    > Is there any way to start that bat file in a specified working dir
    > from the registry, e.g. in "\servershare" ?<!--colorc--><!--/colorc-->
     

Share This Page