I have no idea about this, and what you are attempting to do is a complete mystery to me,
But, something I noticed about the DOS command. You will probably know that DOS doesn't handle spaces in file names and paths very well.
What would happen if you enclosed the whole path and file name in quotes?
I am probably well off the mark, and I doubt it addresses the "not a valid Win32 application" error anyway.
I created an XML editor in Java and I want to set it up as the default application when I double-click an XML file. I've set up other file associations before, but for some reason the same steps aren't working when I try to associate a file extension to a .jar file (my Java app).
When I go the normal path of setting up the file association (Tools -> Folder Options -> browse to my app), Windows seems to take it fine, but when I double-click on an XML file it says "<filename.xml> is not a valid Win32 application." That seems strange to me because it's complaining about the XML file itself not being a valid app, rather than my XML Editor app that I actually pointed that file extension at.
So I tried using 'assoc' and 'ftype' in a DOS console:
C:\>ftype XMLFile=C:\Program Files (x86)\Java\jre1.6.0_07\bin\java -cp C:\JavaProjects\XMLEditor\dist\XMLEditor.jar %1
XMLFile=C:\Program Files (x86)\Java\jre1.6.0_07\bin\java -cp C:\JavaProjects\XMLEditor\dist\XMLEditor.jar %1
Based on the output, it looks like there were no errors. But still, double-clicking an XML file causes the same Windows error message: "<filename.xml> is not a valid Win32 application."
Has anyone else tried to do this before and actually succeeded?