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

    snapin can't execute the appassociation command properly

    Scheduled Pinned Locked Moved Solved
    Windows Problems
    4
    10
    945
    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.
    • K
      kalafina
      last edited by

      the snapin configuration page
      9e129f93-417e-4438-9009-67dc6bf7dce4-image.png
      the fog log on the client machine
      b33d5927-6e60-46ad-a86c-9070eec6293c-image.png
      Hi,everyone!I use "dism.exe /online /export-defaultappassociations:appassoc.xml " to export the xml file. I use ‘dism.exe /online /import-defaultappassociations:appassoc.xml’ on the local machine to test and it worked.But i deploy the snapin to the client machine,it returned 87 code.the error code seemed to be the unknown option.I don’t how to address it.

      R 1 Reply Last reply Reply Quote 0
      • R
        rodluz Developer @kalafina
        last edited by

        @kalafina Hi, DISM’s error code 87 is often because of an incorrectly formatted command.
        The issues could be because you are trying to run this command with a relative path of the xml file instead of the absolute path.

        You can try changing the Snapin Run With Argument to “/c dism.exe /online /import-defaultappassociations:C:\Program Files(x86)\FOG\tmp\”
        I’m not sure how the command will react to the space in the file path.


        This is what I do for my default app associations snapins. I create a snapin pack with the xml file and a batch file that moves the xml file to the C drive then runs the dism command with the absolute path (dism.exe /online /import-defaultappassociations:c:\appassoc.xml)

        Hope this helps!

        1 Reply Last reply Reply Quote 3
        • K
          kalafina
          last edited by

          @rodluz Thank you for your reply .I changed the relative path to absolute path,but it didn’t work.It still returned error code 87.How do you move the xml to C driver?Just using move command? Can you share the command? Thanks in advance.

          Tom ElliottT 1 Reply Last reply Reply Quote 0
          • Tom ElliottT
            Tom Elliott @kalafina
            last edited by Tom Elliott

            @kalafina What if you set Snapin Run with Argument to:

            /c dism.exe /online /import-defaultappassociations:C:\Program Files (x86)\FOG\tmp\appassoc.xml & REM
            

            The idea is tell it to run the command, then comment out the part where it’s loading the file itself.

            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! Get in contact with me (chat bubble in the top right corner) if you want to join in.

            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

            L 1 Reply Last reply Reply Quote 0
            • L
              lukebarone @Tom Elliott
              last edited by

              @Tom-Elliott Try with the path starting with %~dp0. For example:

              /c dism.exe /online /import-defaultappassociations:%~dp0\appassoc.xml
              

              That variable will map to the current drive and path. If the appassoc.xml file is in the same folder as where FOG is running the command, it should auto-expand and auto-escape the characters (i.e. spaces).

              K 1 Reply Last reply Reply Quote 0
              • K
                kalafina @lukebarone
                last edited by

                @lukebarone it seemed to add a space between Snapin Run With Argument and snapin file name.I think the relative path is not the problem. Although I change to the absolute path . the file name also expanded to the full path.

                relative path:
                snapin_relative_path.png
                snapin_relative_path_log.png
                snapin_relative_path_dism_log.png

                absolute_path_snapin.png
                absolute_path_log.png absolute_path_dism_log.png

                L 1 Reply Last reply Reply Quote 0
                • L
                  lukebarone @kalafina
                  last edited by

                  @kalafina So that’s showing that the DISM command doesn’t like spaces, even when surrounded by quotation marks.

                  I’d suggest creating a simple .CMD file and running that. For example (untested):

                  @echo off
                  copy /y \\server\share\appassoc.xml C:\
                  dism.exe /online /import-defaultappassociations:C:\appassoc.xml
                  

                  Obviously, replace \\server\share with a path that is network-reachable from your client.

                  …

                  On the other hand, looking at your “Snapin Command read-only”, it looks like you have a syntax error anyways - the appassoc.xml part should NOT have a space before it when including the path.

                  Another thing to try is instead of running the cmd.exe, run dism.exe for the Snapin Run With, Argument set to /online /import-defaultappassociations:, and see what that produces?

                  K 1 Reply Last reply Reply Quote 1
                  • K
                    kalafina @lukebarone
                    last edited by kalafina

                    @lukebarone the space was added by fog. fog will automatically add a space between snapin run with argument and snapin file.But the option /import-defaultappassociations: doesn’t expect a space.if add a space,it thought missing required argument!
                    Besides,if I put the xml file on the network location,what network service should I use?

                    L 1 Reply Last reply Reply Quote 0
                    • L
                      lukebarone @kalafina
                      last edited by

                      @kalafina I use Samba on a file server. Since you’re running Windows clients, it should work with minimal setup. You need to ensure that wherever the file is stored that the computer account can access it, not necessarily just the user.

                      But you are right - FOG is defaulting to adding the uploaded snapin file to the end of the command line. There is a walkthrough for adding a Wi-Fi key as a snapin that includes how to upload a ZIP file and run a command from inside - I’d recommend trying that if the above isn’t working.

                      https://www.youtube.com/watch?v=M-HXtqeukks

                      K 1 Reply Last reply Reply Quote 1
                      • K
                        kalafina @lukebarone
                        last edited by

                        @lukebarone Thank you very much.It worked!

                        1 Reply Last reply Reply Quote 0
                        • [[undefined-on, S Sebastian Roth, ]]
                        • 1 / 1
                        • First post
                          Last post

                        153

                        Online

                        12.0k

                        Users

                        17.3k

                        Topics

                        155.2k

                        Posts
                        Copyright © 2012-2024 FOG Project