Multi Commander > Feature Requests and Suggestions
Starting the Windows Store App mit Command Line Parameters
(1/1)
multicart:
Hi Mathias,
I have the Windows Store App version of MC. Company policy.
Now, I want to start it with CLPs. I asked MS Copilot.
I do find the installation path in the UWP_Apps_List.txt created with the PowerShell command Get-AppxPackage.
I saw that there is a seemingly normal MultiCommander.exe.
When I start it with CLPs, everything seems to work fine as expected.
However, MS Copilot warned me against starting that exe directly, since it supposedly could have undesired side-effects, since a Windows Store App is not supposed to be started with an exe directly.
So, I thought, I ask the dev directly. What do you recommend?
Many thx, regards, m.
Mathias (Author):
Actually I'm not sure how the Windows Store App work.. MC is a full thrust .exe store app. But it does sandbox some folders (System and system registry, so MC store edition cannot modify them)
Since MC is a full .exe app and not a UWP app I think you can start the exe, But i'm not 100% sure.
There should be way to start them from command line using the app package names.. But I'n not sure exactly how that works.
multicart:
For all MC users:
ok, I now managed to do it this way:
1) A PowerShell script that starts the MC App with command line parameters:
--- Code: ---# Despite the -WindowStyle Hidden parameter, the PowerShell window still pops up briefly.
# Therefore, I am starting this script with a separate vb script.
# For some reason, with the vb script, I can avoid any window to pop other than MC itself, which was not possible with the PS script.
$appPackage = "48089MathiasSvensson.MultiCommander_9d7x1c4ybj2dr!MultiCommander"
$arguments = "-AutoRun=_UDC_runAt_MC_Startup"
Start-Process -FilePath "shell:AppsFolder\$appPackage" -ArgumentList $arguments -WindowStyle Hidden
--- End code ---
Hint: I had previously tried to start the MC App with a shortcut using eplorer.exe (something like "explorer.exe shell:AppsFolder\[MC app folder]![AppId] [parameter]") but in this way it would not work to hand over any command line parameters. It would start the app without parameters, but as soon as I added them it would not even start anymore. I tried all kinds of variants with the quotes, but the only solution that I finally found was to use the PS script.
2) A VB script that starts the PS script in order to prevent the PS window from popping up:
--- Code: ---' MsgBox "Just for testing: VB script started", 0, "VB script started"
Set objShell = CreateObject("WScript.Shell")
objShell.Run "powershell.exe -NoProfile -ExecutionPolicy Bypass -File ""[name of powershell script].ps1""", 0, False
--- End code ---
3) A shortcut to the VB script in order to be able to pin it to the task bar:
Target:
--- Code: ---C:\Windows\System32\wscript.exe "[path and name of VB script].vbs"
--- End code ---
Hint: I found out the hard way, that for some reason it is possible that the task bar does not like shortcuts with defined working directories that deviate from the path in the target definition.
So, the PowerShell does the heavy lifting. If you are ok, without the option to start it from the taskbar and are ok with the PowerShell window to pop up briefly, then you only need the ps1 script.
And regarding the taskbar, unfortunately there is a drawback, that can not be changed AFAIK. Since the shortcuts points to wscript.exe, it will be a separate item on the taskbar and the actual MC item will pop up or exist next to it, ending up in the shortcut item that starts MC and then MC (when its running) on its own with a separate item. Not really pretty, but I found no solution. So far, I personally rather have the starting shortcut in the taskbar, and live with the fact that the running MC item is next to it, than not having the starting shortcut in the taskbar.
regards, m.
Mathias (Author):
Nice. special "shell:" tag for the Windows App was needed.
However it did not work using .bat script? Powershell it way over powered for just starting something.
Startmc.bat
--- Code: ---start shell:AppsFolder\48089MathiasSvensson.MultiCommander_9d7x1c4ybj2dr!MultiCommander -AutoRun=_UDC_runAt_MC_Startup
--- End code ---
It will show a console window very briefly. But if you create a Lnk shortcut for it
startmc_shortcut.lnk
And in properties for it. Set it to start minimized. Then the command window is not shown while it starts MC store edition
multicart:
Thank you, that works almost as good.
If you want to pin the shortcut to the taskbar, the target in the shortcut could be:
cmd.exe /c "[path to startmc.bat]\startmc.bat"
Navigation
[0] Message Index
Go to full version