[R] Windows Shell Command under Vista

Gabor Grothendieck ggrothendieck at gmail.com
Thu Jan 3 05:48:54 CET 2008


On Jan 2, 2008 9:24 PM, Gabor Grothendieck <ggrothendieck at gmail.com> wrote:
> On Jan 2, 2008 9:49 AM, Dieter Menne <dieter.menne at menne-biomed.de> wrote:
> > Dear R2008,
> >
> > In Windows 2000, I used the following shell extension to allow right-click
> > rgui start in a directory (assuming rgui.exe is on the path:
> >
> > -----
> > REGEDIT4
> >
> >
> > [HKEY_CLASSES_ROOT\Directory\shell\Run R]
> >
> >
> > [HKEY_CLASSES_ROOT\Directory\shell\Run R\command]
> > @="Rgui.exe --no-restore --no-save --internet2"
> > ----
> >
> > I switched to Vista this year. For reasons I don't understand, I have to
> > give the full path now, even if rgui is on the path. However, the solution
>
> Try this batch file which is in the devel svn repository of batchfiles:
> http://batchfiles.googlecode.com/svn/trunk/RguiStart.bat

I should have pointed out, as its not yet documented in batchfiles,
that the idea
is to copy RguiStart.bat to your %APPDATA%\Microsoft\Windows\SendTo
folder so that right clicking a folder in Windows Explorer and choosing
SendTo > RguiStart.bat will start up R in the folder that was right
clicked on.
No need to mess with the registry.

Of course if you have an .Rdata file in the directory then even that
is unnecessary
as you can just double click the .Rdata file to start R with that
.Rdata file loaded
(assuming you have allowed the R/.Rdata file type association when you
installed R -- if you did not then you can use the SendTo method with files
as well as directories).

>
> (Also see: http://batchfiles.googlecode.com)
>
> Given a directory specified in argument 1 it will find R in the
> registry (and look in a few
> other places if not found there) and start Rgui.exe in specified directory.
> This has the additional benefit that when you upgrade to a new version
> of R you don't have to change anything.
>
> > below does not really work, getwd() is always in \windows\system32. I tried
> > several cmd.exe "..." variations, without success (strangled by "\""\"?) And
> > a nasty feature of Vista is the long delay of 19 seconds until a command box
> > comes up on my computer.
> >
>
> How are you starting up the command line?  If I position myself to the right
> side of the Windows Explorer window in Vista and press Shift-RightClick and then
> choose Open Command Window Here then the command window
> comes up instantaneously on my system -- there is no discernable delay
> at all.
>
>
> > To avoid RTFMs: I know how to do this with setwd().
> >
> > Dieter
> >
> > ------
> > Windows Registry Editor Version 5.00
> >
> >
> > [HKEY_CLASSES_ROOT\Directory\shell\Run R]
> >
> > [HKEY_CLASSES_ROOT\Directory\shell\Run R\command]
> > @="\"C:\\Program Files\\R\\R-2.6.0\\bin\\Rgui.exe\" --internet2 --no-save
> > --no-restore"
>




More information about the R-help mailing list