script neanderthal Posted September 27, 2012 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? Link to comment Share on other sites More sharing options...
script neanderthal Posted September 27, 2012 Author 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" Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now