- Create a VBScript file. See attachment for source code. It looks for a folder that ends with ".X", in the same directory as the script file. If more than one is found, it looks for a folder with a similar name as the script file, e.g. MyProject.mplabx will open the project in the folder named MyProject.X.
- Rename the script file to ".mplabx".
- Add an association to the Windows registry for opening .mplabx as a file that can be run by the Windows scripting host. The most important part here is the HKCR\MPLABXFile\ScriptEngine\(Default Value) needs to be set to "VBScript". The attached registry file sets up this association and sets the icon for the new file type. This reg file is based on the built-in .vbs and VBSFile keys.
- Add an environment variable named "MPLABX" which points to the installation location of MPLABX. The command sent by the script uses that variable to determine the location, like this: "%MPLABX%\mplab_ide\bin\mplab_ide.exe"