Forum Discussion
Shortcut pointing to Batch script (.bat file) - PSF Tool not worked.
Hi All,
Scenario: I have an app with multiple shortcuts, in those one shortcut's Target is "cmd.exe" and argument is path of a batch script file(.bat file). I have tried to create MSIX package with the help of PSF Tool. while testing I am able to launch every shortcut, except this one (which has batch script).
I tried the below things:
1. As we know there is no communication between MSIX container and the native cmd.exe file, I have copied cmd.exe (which is not recommendable) file into msix package and tried to launch the shortcut. It didn't work.
2. In config.json file, replaced cmd.exe with the psflauncher.exe in place of target, which mean this psflauncher will call the .bat file to execute. It didn't work
3. In config.json file, placed .bat file path in Target place with out any arguments. It didn't work.
Is there any thing else to try other than above, please advise and guide.
Thanks in Advance.
34 Replies
- mohant1850Copper Contributor
Siva116 you can follow below steps for .bat shortcuts creation.
- Open the AppxManifest.xml file and choose one of the following actions:
- Create a new “Application” element there and set the “Executable” attribute to point to the PsfLauncher executable.
- Update the “Application” element and set the “Executable” to point to the PsfLauncher executable.
- Create a config.json file as shown below, as per you are application name, .bat file location etc.. make sure "id" should be same in manifest file aswell as config file.
- Add the corresponding PSF files along with the config.json file created at step 4 into your MSIX package.
PsfLauncher32.exe/PsfLauncher64.exe
PsfRunDll32.exe/PsfRunDll64.exe
PsfRuntime32.dll/PsfRuntime64.dll
StartMenuCmdScriptWrapper.ps1
- Abir_KumarSCopper Contributor
mohant1850 - I have applied the same config.json but it is still not working.
- mohant1850Copper ContributorFirst, we need to run the batch file manually. In the Task Manager’s Details column, you can choose the Command Line option to identify the command. Use the same command line; in my case, it was /c.
- Siva116Brass ContributorHi @ Johan Pol, I didn't get any solution.
- PollewopsIron ContributorI got it working now. I guess it is a bug, but when you configures a startscript in the config.json it starts working.
- Siva116Brass ContributorHi @ Pollewops
If possible, could you please paste or attach that config.json file for reference.. I would like to try it.
Thanks in Advance.
- PollewopsIron ContributorHi, i am trying the same. Did you get it working already?
- Siva116Brass Contributor
Can anyone help me on this situation.......frequently I am facing the scenario, where target has cmd.exe and argument has a .bat file or sometimes directly .bat file in target, there type of shortcuts were not working even with psf tool also.
- I assume from this "PSF Tool" here is PsfTooling and you are capturing an installer using the Microsoft MSIX Packaging Tool. PsfTooling should detect your shortcut to the cmd file and do everything for you.
If my assumption is correct: Can you share the contents of the cmd file, as well as the config.json file? If you don't want to post them here, reach out to me as tmangan @ tmurgent.com
If you are building a package in other ways, you'll need to provide those details.