script neanderthal
-
Posts
2 -
Joined
-
Last visited
Content Type
Profiles
Forums
Events
Posts posted by script neanderthal
-
-
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?
Complex shortcuts made with vbs
in VBScript
Posted
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"