snapin can't execute the appassociation command properly
-
the snapin configuration page
the fog log on the client machine
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. -
@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!
-
-
@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.
-
@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). -
@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:
-
@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? -
@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? -
@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.
-
@lukebarone Thank you very much.It worked!
-