2

I would like to run a few NirCmds when running an application such that it will change the primary display to the extended monitor, run the app and then switch back when finished. Ideally I would like to create this as a context menu option. Since this is using multiple commands I thought of using the script functionality from nircmd such as:

script "$folder.desktop/testscript.ncl" 

with the script containing the lines I needed:

setprimarydisplay(2)
exec max "???.exe"
waitprocess ???.exe setprimarydisplay(1)

However I am not sure how to pass the process name from the context menu into the script or if this is even possible. Does anyone know how to do this or am I approaching this the wrong way?

I have the process location from the context menu as %1, so the issue is really just passing this into the script. Something like:

script "$folder.desktop/testscript.ncl" -%1
4

0 回答 0