0
I want to create a shell extension to run shiny apps in a local process on a Windows 7 Professional 64 bit. I need a command like R -e "shiny::runApp('~/shinyapp')"
as defined in the shiny tutorial webpage. I usually create a directory called shiny
in every data folder I have. So the supposed command should be always sth like: R -e "shiny::runApp('%1'/shiny) for me."
So I created a key named "Shine!" and a subkey named "command" in HKEY_CLASSES_ROOT\Directory\shell with a value C:\Program Files\R\R-2.15.1\bin\x64\R.exe -e "shiny::runApp('%1/shiny')"
The dir structure in regedit is as below:
Now, whenever I right-click the data folder (containing the shiny folder) and click "Shine!", an R console (a cmd console) opens and closes, but the app is not working (the apps are thoroughly checked and working, I also checked the regedit command in cmd).
To be honest, I don't know C, windows shell or any MSDN stuff. I checked several questions, links and documents, but preferred to come up with a simple solution with no error checking (missing folder, etc).
I think I'm missing a syntax error here, so I tried several versions such as only '%1'
and right-clicking the shiny folder, also versions like '/'%1/'/shiny'
etc. What is wrong and more importantly, how can I debug a right-click with the %1 thing, while the cmd window is closing as quick as hell?
You are probably right about the Windows path error, but I couldn't make the
– barerd – 2013-05-13T15:02:25.353cmd /k
work with the quotes. This answer says the correct format for /k switch is sth likecmd /k "code"
. I triedcmd /k "'C:\Program Files\R\R-2.15.1\bin\R.exe' -e "shiny::runApp('%1')""
but didn't work also. I tried to escape the double quote with ^ or "" according to this question. Could you provide any more examples?Enclosing sth in quotes in double quotes means using triple quotes around many things. So, now
cmd /c "cd %1 & """C:\Program Files\R\R-2.15.1\bin\x64\R.exe""" -e """shiny::runApp("'shiny'")""""
works but /c switch doesn't close the cmd window. It doesn't hurt actually, it's good enough that I don't need to type the whole thing, but is there any trick to close the cmd window? – barerd – 2013-05-13T19:14:09.580