Richard M. Heiberger
2007-May-12 03:28 UTC
[R] Fwd: Re: shell.exec() on Windows, unexpected behavior
Duncan is on the right track. Thanks. In the CMD window start "c:\Program Files\R\R-2.5.0\doc\manual\R-admin.pdf" opens another CMD window with the quoted string as title. In the CMD window start c:\Progra~1\R\R-2.5.0\doc\manual\R-admin.pdf (with the 8.3 name and no embedded blanks) opens Adobe Reader 8 Windows Explorer shows the Adobe 6 icon by the PDF files. The Windows Explorer right-click menu shows three actions Open with Adobe Reader 8 Open Print The "Open" item uses Adobe Acrobat 6. The "Tools/Folder Options/File Types" menu shows and Adobe 6 icon. The details sections shows the Adobe 8 icon. The "Advanced" button shows three actions Open with Acrobat 6 Print Printto I attempted to edit the "Open with Acrobat 6" to "Open with Acrobat 8". It didn't take. So I did a restore. I will now just have an open Acrobat 8 around when I care which version is used. I am guessing that Adobe Reader 8 (a read-only program) saw that Adobe Acrobat 6 (a read/write program) was installed. Therefore it assumed that the user would want the write potential of the older program to take precedence over the read-only potential of the newer program. It looks to me like there are some inconsistencies in how it made those arrangements. Rich ---- Original message ---->Date: Fri, 11 May 2007 21:14:31 -0400 >From: Duncan Murdoch <murdoch at stats.uwo.ca> > >shell.exec("foo.pdf") does the same thing that "start foo.pdf" would do >from a Windows command line. Do you see the same behaviour there? I >think this is also usually the same thing as a right click Open does, >but that may be changeable. > >What may be happening is that Acrobat has installed some fancy shell >extension that doesn't execute an "open" on the file, it does something >else instead. > >Duncan Murdoch
Gabor Grothendieck
2007-May-12 03:59 UTC
[R] Fwd: Re: shell.exec() on Windows, unexpected behavior
This is yet another guess but it might be that its not a matter of whether its installed or not but whether its running (possibly in the background). If that were the case then forcing a new instance might solve it. Have a look at the last page of the following for the command line switches: http://www.adobe.com/devnet/acrobat/pdfs/Acrobat_SDK_developer_faq.pdf#Page=24 The /n switch forces a new instance of either to run, i.e. from the Windows command line: start acrobat.exe /n myfile.pdf start acrord32.exe /n myfile.pdf On 5/11/07, Richard M. Heiberger <rmh at temple.edu> wrote:> Duncan is on the right track. > > Thanks. > > > > In the CMD window > start "c:\Program Files\R\R-2.5.0\doc\manual\R-admin.pdf" > opens another CMD window with the quoted string as title. > > In the CMD window > start c:\Progra~1\R\R-2.5.0\doc\manual\R-admin.pdf > (with the 8.3 name and no embedded blanks) opens Adobe Reader 8 > > Windows Explorer shows the Adobe 6 icon by the PDF files. > > The Windows Explorer right-click menu shows three actions > Open with Adobe Reader 8 > Open > Print > The "Open" item uses Adobe Acrobat 6. > > The "Tools/Folder Options/File Types" menu shows and Adobe 6 > icon. The details sections shows the Adobe 8 icon. The "Advanced" > button shows three actions > Open with Acrobat 6 > Print > Printto > > I attempted to edit the "Open with Acrobat 6" to "Open with > Acrobat 8". It didn't take. So I did a restore. I will now > just have an open Acrobat 8 around when I care which version is > used. > > > I am guessing that Adobe Reader 8 (a read-only program) saw that > Adobe Acrobat 6 (a read/write program) was installed. Therefore > it assumed that the user would want the write potential of the > older program to take precedence over the read-only potential of > the newer program. It looks to me like there are some inconsistencies > in how it made those arrangements. > > Rich > > > ---- Original message ---- > >Date: Fri, 11 May 2007 21:14:31 -0400 > >From: Duncan Murdoch <murdoch at stats.uwo.ca> > > > >shell.exec("foo.pdf") does the same thing that "start foo.pdf" would do > >from a Windows command line. Do you see the same behaviour there? I > >think this is also usually the same thing as a right click Open does, > >but that may be changeable. > > > >What may be happening is that Acrobat has installed some fancy shell > >extension that doesn't execute an "open" on the file, it does something > >else instead. > > > >Duncan Murdoch > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. >
Duncan Murdoch
2007-May-12 12:07 UTC
[R] Fwd: Re: shell.exec() on Windows, unexpected behavior
On 11/05/2007 11:28 PM, Richard M. Heiberger wrote:> Duncan is on the right track. > > Thanks. > > > > In the CMD window > start "c:\Program Files\R\R-2.5.0\doc\manual\R-admin.pdf" > opens another CMD window with the quoted string as title. > > In the CMD window > start c:\Progra~1\R\R-2.5.0\doc\manual\R-admin.pdf > (with the 8.3 name and no embedded blanks) opens Adobe Reader 8You could also do start "title" "c:\Program Files\R\R-2.5.0\doc\manual\R-admin.pdf" I'd never noticed that start sees the quotes as syntactically meaningful. Weird people work at Microsoft.> > Windows Explorer shows the Adobe 6 icon by the PDF files. > > The Windows Explorer right-click menu shows three actions > Open with Adobe Reader 8 > Open > Print > The "Open" item uses Adobe Acrobat 6. > > The "Tools/Folder Options/File Types" menu shows and Adobe 6 > icon. The details sections shows the Adobe 8 icon. The "Advanced" > button shows three actions > Open with Acrobat 6 > Print > Printto > > I attempted to edit the "Open with Acrobat 6" to "Open with > Acrobat 8". It didn't take. So I did a restore. I will now > just have an open Acrobat 8 around when I care which version is > used.If you want to try again, this stuff is all controlled in the registry within HKEY_CLASSES_ROOT\AcroExch.Document\shell, at least in Acrobat 5, which I've got. The various options "open", "print", "printto" would normally be stored there, for example with HKEY_CLASSES_ROOT\AcroExch.Document\shell\open\command set to "C:\Program Files\Adobe\Acrobat 5.0\Reader\AcroRd32.exe" "%1" (on my system). The trouble with this kind of editing is that programs could instead install CLSID values, and then you won't see the "open", "print", "printto" choices. Before you make changes to these things with regedit, I'd recommend exporting the branch so you can restore it if things go badly. Duncan> > > I am guessing that Adobe Reader 8 (a read-only program) saw that > Adobe Acrobat 6 (a read/write program) was installed. Therefore > it assumed that the user would want the write potential of the > older program to take precedence over the read-only potential of > the newer program. It looks to me like there are some inconsistencies > in how it made those arrangements. > > Rich > > > ---- Original message ---- >> Date: Fri, 11 May 2007 21:14:31 -0400 >> From: Duncan Murdoch <murdoch at stats.uwo.ca> >> >> shell.exec("foo.pdf") does the same thing that "start foo.pdf" would do >>from a Windows command line. Do you see the same behaviour there? I >> think this is also usually the same thing as a right click Open does, >> but that may be changeable. >> >> What may be happening is that Acrobat has installed some fancy shell >> extension that doesn't execute an "open" on the file, it does something >> else instead. >> >> Duncan Murdoch > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code.