• Recent
    • Unsolved
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login

    Snapin Batch file stays in-progress

    Scheduled Pinned Locked Moved Solved
    FOG Problems
    4
    15
    1.5k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • george1421G
      george1421 Moderator @Arjenbulkens
      last edited by

      @Arjenbulkens said in Snapin Batch file stays in-progress:

      The batchfile deletes a registry key

      What is the base path for the key? (HKLM, HKCU,??)

      Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG!

      A 1 Reply Last reply Reply Quote 0
      • A
        Arjenbulkens @george1421
        last edited by

        @george1421 HKLM

        george1421G 1 Reply Last reply Reply Quote 0
        • george1421G
          george1421 Moderator @Arjenbulkens
          last edited by

          @Arjenbulkens OK what is the command you are using inside this batch file to delete the key?
          The FOG Client runs as the user SYSTEM, so it should have full access to delete from HKLM. I’m still leaning towards an unanswered prompt doing this.

          Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG!

          A 1 Reply Last reply Reply Quote 0
          • A
            Arjenbulkens @fry_p
            last edited by

            @fry_p ok, i will try ^^

            1 Reply Last reply Reply Quote 0
            • A
              Arjenbulkens @george1421
              last edited by

              @george1421

              4c2d397b-19cf-4b79-8d2d-e84160df44b2-image.png

              george1421G 2 Replies Last reply Reply Quote 0
              • george1421G
                george1421 Moderator @Arjenbulkens
                last edited by

                @Arjenbulkens This should work. But to debug what happens if you only run the delete command? Right now its not clear which command is causing it to hang, I might guess the delete key.

                I also wonder what the logic is to delete the key and add it back, why not just use the add key to change its value?

                Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG!

                1 Reply Last reply Reply Quote 0
                • george1421G
                  george1421 Moderator @Arjenbulkens
                  last edited by

                  @Arjenbulkens I also wonder if its the full name of the base key that is at fault?

                  HKLM, HKCU, HKCR, HKU, and HKCC is from the MS doc for reg add
                  ref: https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/reg-add

                  Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG!

                  A 1 Reply Last reply Reply Quote 0
                  • A
                    Arjenbulkens @george1421
                    last edited by

                    @george1421 It was the delete line, now the snapin in completed successfully. But the registry key value is still the same…

                    When i run the bat file manually, it works fine 😞

                    george1421G 1 Reply Last reply Reply Quote 0
                    • george1421G
                      george1421 Moderator @Arjenbulkens
                      last edited by

                      @Arjenbulkens I’ve been trying to understand why this would fail if run by the fog snapin.

                      I reverse engineered the command and I came up with the same syntax as you.

                      REG ADD "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" /v "AutoAdminLogon" /t "REG_SZ" /d "0" /f

                      I checked and on my system SYSTEM has full edit rights to that key too. You can execute the command from a raised admin prompt OK, so why can’t SYSTEM. I’m logged into a linux computer at the moment so I can’t test, but I know I’ve seen the “Run as Administrator” and “Run as another user”. I wonder if we can “run as another user” and pick SYSTEM as the user account. You WILL need to be a local administrator on the box to get the run as a different user prompt.

                      Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG!

                      1 Reply Last reply Reply Quote 0
                      • S
                        Sebastian Roth Moderator
                        last edited by

                        @Arjenbulkens Please download Sysinternals PSExec and try this:

                        C:\Windows\system32>whoami
                        ...\Administrator
                        
                        C:\Windows\system32>PsExec.exe -S cmd.exe
                        
                        PsExec v2.2 - Execute processes remotely
                        Copyright (C) 2001-2016 Mark Russinovich
                        Sysinternals - www.sysinternals.com
                        
                        
                        Microsoft Windows [version 6.1.7601]
                        Copyright (c) 2009 Microsoft Corporation. Tous droits réservés.
                        
                        C:\Windows\system32>whoami
                        NT AUTHORITY\SYSTEM
                        
                        C:\Windows\system32>REG DELETE ...
                        ...
                        C:\Windows\system32>REG ADD ...
                        ...
                        

                        Web GUI issue? Please check apache error (debian/ubuntu: /var/log/apache2/error.log, centos/fedora/rhel: /var/log/httpd/error_log) and php-fpm log (/var/log/php*-fpm.log)

                        Please support FOG if you like it: https://wiki.fogproject.org/wiki/index.php/Support_FOG

                        1 Reply Last reply Reply Quote 0
                        • S
                          Sebastian Roth Moderator
                          last edited by

                          @Arjenbulkens Any news on this?

                          Web GUI issue? Please check apache error (debian/ubuntu: /var/log/apache2/error.log, centos/fedora/rhel: /var/log/httpd/error_log) and php-fpm log (/var/log/php*-fpm.log)

                          Please support FOG if you like it: https://wiki.fogproject.org/wiki/index.php/Support_FOG

                          1 Reply Last reply Reply Quote 0
                          • 1 / 1
                          • First post
                            Last post

                          173

                          Online

                          12.0k

                          Users

                          17.3k

                          Topics

                          155.2k

                          Posts
                          Copyright © 2012-2024 FOG Project