• Recent
  • Unsolved
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Register
  • Login
  • 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
1.0k
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 Feb 12, 2023, 6:19 AM

    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 Feb 13, 2023, 4:01 AM Reply Quote 0
    • R
      rodluz Developer @kalafina
      last edited by Feb 13, 2023, 4:01 AM

      @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!

      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

      1 Reply Last reply Reply Quote 3
      • K
        kalafina
        last edited by Feb 14, 2023, 1:10 PM

        @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.

        T 1 Reply Last reply Feb 14, 2023, 3:36 PM Reply Quote 0
        • T
          Tom Elliott @kalafina
          last edited by Tom Elliott Feb 14, 2023, 9:36 AM Feb 14, 2023, 3:36 PM

          @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 Feb 14, 2023, 7:19 PM Reply Quote 0
          • L
            lukebarone @Tom Elliott
            last edited by Feb 14, 2023, 7:19 PM

            @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 Feb 15, 2023, 2:25 PM Reply Quote 0
            • K
              kalafina @lukebarone
              last edited by Feb 15, 2023, 2:25 PM

              @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 Feb 15, 2023, 5:47 PM Reply Quote 0
              • L
                lukebarone @kalafina
                last edited by Feb 15, 2023, 5:47 PM

                @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 Feb 18, 2023, 5:02 AM Reply Quote 1
                • K
                  kalafina @lukebarone
                  last edited by kalafina Feb 17, 2023, 11:06 PM Feb 18, 2023, 5:02 AM

                  @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 Feb 18, 2023, 5:58 AM Reply Quote 0
                  • L
                    lukebarone @kalafina
                    last edited by Feb 18, 2023, 5:58 AM

                    @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 Feb 18, 2023, 6:57 AM Reply Quote 1
                    • K
                      kalafina @lukebarone
                      last edited by Feb 18, 2023, 6:57 AM

                      @lukebarone Thank you very much.It worked!

                      1 Reply Last reply Reply Quote 0
                      • [[undefined-on, S Sebastian Roth, Feb 18, 2023, 7:06 AM]]
                      • 1 / 1
                      1 / 1
                      • First post
                        2/10
                        Last post

                      179

                      Online

                      12.0k

                      Users

                      17.3k

                      Topics

                      155.2k

                      Posts
                      Copyright © 2012-2024 FOG Project