script neanderthal 0 Posted September 27, 2012 Report Share Posted September 27, 2012 From a 'Run' command it is possible to open a pdf file in Acrobat Reader with parameters:e.g. "C:\Program Files (x86)\Adobe\Reader 10.0\Reader" /A "zoom=100" "K:\Documents\mypdf.pdf"and it is possible to make a desktop shortcut manually to do the same thing. I'd like to be able to create a such a shortcut programmatically using vbscript for example, so as to ensure my particular pdf file is only opened in Acrobat Reader and NOT Acrobat or any other pdf reader which might be installed. Set Shell = CreateObject("WScript.Shell")ARpath = Shell.Regread("HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\AcroRd32.exe\path")ARapp = Shell.Regread("HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\AcroRd32.exe\")PDFfile="K:\Documents\mypdf.pdf"sctarget = """"& ARapp & """" & " /A " & """zoom=100"" " & """"&PDFfile&""""msgbox sctargetShell.run sctarget this works fine so far, but the shortcut creation part throws up an error. DesktopPath = Shell.SpecialFolders("Desktop")Set link = Shell.CreateShortcut(DesktopPath & "\mypdf.lnk")link.WorkingDirectory = ARpathlink.TargetPath = sctargetlink.Save Any suggestions? Quote Link to post Share on other sites
script neanderthal 0 Posted September 27, 2012 Author Report Share Posted September 27, 2012 Oh yeah - that command line in the first paragraph should have read:"C:\Program Files (x86)\Adobe\Reader 10.0\Reader\AcroRd32.exe" /A "zoom=100" "K:\Documents\mypdf.pdf" Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.