/build/static/layout/Breadcrumb_cap_w.png

How do I remove some of the data from a registry string with a KScript?

Im trying to modify the HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon string: Userinit

After the system image is deployed the Library window pops up after login.  I need to remove the C:\Windows\System32\KUsrInit.exe, from String name: Userinit. 

The Userinit string only needs to have: C:\Windows\system32\userinit.exe,

This is the currently incorrect String Value: C:\Windows\system32\userinit.exe,C:\Windows\System32\KUsrInit.exe,

Im trying to do this with a KScript and cannot get the set a regisrty value option to work.

Kace Appliance version: 5.5.90547


0 Comments   [ + ] Show comments

Answers (1)

Answer Summary:
Changing the reg key command to: hklm64 did the trick!! Thanks SMal.tmcc
Posted by: SMal.tmcc 10 years ago
Red Belt
0

if you have the kace agent installed these are the correct values

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon]
"Userinit"="C:\\Windows\\System32\\KUsrInit.exe,"
"KUserinitReplaced"="C:\\Windows\\system32\\userinit.exe,"

without agent should be

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon]
"Userinit"="C:\\Windows\\System32\\UsrInit.exe,"
"KUserinitReplaced"=-

before you remove this read:

http://www.itninja.com/question/userinit-registry-setting

but if want to use the kbox to remove part of the agent you do it this way

rule of thumb is export and create a .reg merge file of the keys you want.  lose the header and paste that into the policies box registry file:

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon]
"Userinit"="C:\\Windows\\System32\\UsrInit.exe,"
"KUserinitReplaced"=-

the second line removes a key you want to remove if you are switching the usrinit back to default


Comments:
  • these are 6.0 screen shots but is the same thing under 5.5 - SMal.tmcc 10 years ago
  • I cannot get the change to take effect on the test computer. I feel like its how i'm deploying the script thats causing the failure. The script is running as local system and Microsoft Windows OS version.

    This is exactly what is in my registry file on Kace.

    The Kace agent is already on the systems since its installed on the syspreped image.

    [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon]
    "Userinit"="C:\\Windows\\System32\\KUsrInit.exe,"
    "KUserinitReplaced"="C:\\Windows\\system32\\userinit.exe,"

    I set the alert user notification to verify its actually running. I have tried "it seems" every possible combination of the parameters to get the change to take effect. - stevezax257 10 years ago
    • are these 64 bit machines - SMal.tmcc 10 years ago
      • Yes, 64 bit image. - stevezax257 10 years ago
      • try making the registry key command hklm64\software\... instaead of HKEY_LOCAL_MACHINE\SOFTWARE - SMal.tmcc 10 years ago
      • you need a push for 32 bit and one for 64 bit machines with changes like this. The kace agent is 32 bit so it will call programs from windows\syswow64 and registry calls like this get written to wow6432node instead of where you want. If drill down under the wow6432node keys to that same spot you will see those keys you tried to write to hklm\software on the machines you ran when it did not have the "64" in the script. by adding the 64 you are forcing the 32bit regedit command to write to the 64bit keyset instead instead of its default of 32. - SMal.tmcc 10 years ago
      • Im now trying to include a BAT Script in the K2000 Postinstallition Task.

        all i have in the BAT Script so far is:

        [hklm64\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon]
        "Userinit"="C:\\Windows\\System32\\KUsrInit.exe,"
        "KUserinitReplaced"="C:\\Windows\\system32\\userinit.exe,"

        I need to call regedit or call reg? im not sure how to initiate the registry change in the BAT script. - stevezax257 10 years ago
      • sorry to confuse you, no that is how the kbox does it in the background for this type of script.
        if you want this to be bit independent you will need to create a cmd call script and

        use launch a program
        and use cmd.exe for the program
        use in the parameters
        /b c:\windows\sysnative\reg.exe /add HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon /v usrinit /d kusrinit /f

        sysnative forces the exe to call from the systems native directory vs the client calling from its native 32bit directory. - SMal.tmcc 10 years ago
      • Im lost when it comes to creating BAT scripts. There is one in the K2000 that turns off UAC.
        reg.exe ADD HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System /v EnableLUA /t REG_DWORD /d 0 /f

        I dont need to add the key i need to modify an existing. I'm trying to locate the switch parameters listed and the purpose. - stevezax257 10 years ago
      • /f switch is force replacement so that is a modify. If you get stuck post new questions or if your script is sensitive use my email under my profile.

        Open a cmd window and do
        reg /?
        reg add /?
        reg delete /?
        for more help on using reg.exe in a batch file.

        pay attention to the key type, the default is reg_sz which is the most used data type in the registry. - SMal.tmcc 10 years ago
      • I keep getting invalid syntax using the following in the cmd window.

        REG ADD HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon /v Usrinit /d C:\Windows\System32\KUsrInit.exe, /f - stevezax257 10 years ago
      • you have spaces so you need quotes.
        reg.exe add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\WinLogon" /v Userinit /d "C:\Windows\system32\KUsrInit.exe," /f

        I will continue with your email you sent me - SMal.tmcc 10 years ago

Don't be a Stranger!

Sign up today to participate, stay informed, earn points and establish a reputation for yourself!

Sign up! or login

View more:

Share

 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ