This is closely related to a solution to another question of mine: How to invoke Windows' gvim in a Windows environment from within Cygwin?
I've now found that giving
explorer.exe 'C:\Program Files (x86)\Vim\vim73\gvim.exe' in the Cygwin command-line opens Windows' gVim in a Windows context properly. I've written a
gvim function in my .bashrc that executes the above command when called without arguments. However, I'd like to know how I can pass on the arguments to the gVim if the function is called with arguments. Trying
explorer.exe 'C:\Program Files (x86)\Vim\vim73\gvim.exe' D:\myfile.txt just opens Windows Explorer to the Libraries page, so this direct syntax doesn't work, but I'm unable to find what the correct way to pass these arguments is.
Googling only gives me the list of switches to explorer.exe but nothing about passing arguments to executables executed with explorer.exe.
Edit: Please note that I'm running this from Cygwin, and I've tried many of the more straightforward solutions before landing on using
explorer.exe, as documented in the question linked at the top.
cmd.exe /c both leave remnants of the Cygwin environment within the opened gVim, which causes some issues as mentioned there.