ksv247 Posted February 10, 2006 Posted February 10, 2006 I've been trying to launch a manual from a script but can't seem to make it work. It's very basic stuff but I'm new to this and I don't have the time to battle with it anymore. This works: Func Doc() Run("explorer.exe G:\Documentation\Help.pdf") EndFunc As well as this: Func Doc() RunWait("explorer.exe G:\Documentation\Help.pdf") EndFunc Of course I can't have it point to a specific letter, instead I want it to point to my scriptdir. One of the things I've tried, that doesn't work: Func Doc() Run("explorer.exe @ScriptDir & "\Documentation\Help.pdf"") EndFunc Any ideas?
Nuffilein805 Posted February 10, 2006 Posted February 10, 2006 (edited) you could look for your acrord32.exe than this is your code run("path\acrord32.exe " & @scriptdir & "\Documentation\Help.pdf") have fun usually the path is @programfilesdir & "\adobe\acrobat *.*\reader\ Edited February 10, 2006 by Nuffilein805 my little chatmy little encryption toolmy little hidermy unsafe clickbot
ksv247 Posted February 10, 2006 Author Posted February 10, 2006 you could look for your acrord32.exe than this is your code run("path\acrord32.exe " & @scriptdir & "\Documentation\Help.pdf") have fun usually the path is @programfilesdir & "\adobe\acrobat *.*\reader\ I want to use explorer to determine whick application to use for opening the pdf file, since I don't want to limit myself to Acrobat/Adobe Reader. Func HB() Run("explorer.exe " & @ScriptDir & "\Documentation\Help.pdf") EndFunc Works! Thanks so much for the help. I had a feeling it was just a small correction that needed to be made. Could I ask for help with one more detail? Is there a way to maximize the window (in my case Acrobat) that is opened when the pdf file is launched?
MuffinMan Posted February 10, 2006 Posted February 10, 2006 Did you try the @SW_Maximize flag? From the help file: Run("Notepad.exe", "", @SW_MAXIMIZE)
wiredbits Posted February 10, 2006 Posted February 10, 2006 I want to use explorer to determine whick application to use for opening the pdf file, since I don't want to limit myself to Acrobat/Adobe Reader.Func HB() Run("explorer.exe " & @ScriptDir & "\Documentation\Help.pdf")EndFuncWorks!Thanks so much for the help. I had a feeling it was just a small correction that needed to be made.Could I ask for help with one more detail?Is there a way to maximize the window (in my case Acrobat) that is opened when the pdf file is launched?Try this:$file=@ScriptDir & "\Documentation\Help.pdf"$command="C:\Windows\System32\Rundll32.exe Url,FileProtocolHandler " & $file Run($command) Hope it helps Jim
ksv247 Posted February 10, 2006 Author Posted February 10, 2006 (edited) Yes, I've tried the @SW_Maximize flag, and now in the way you described (?). Func HB() Run("explorer.exe " & @ScriptDir & "\Documentation\Help.pdf", "", @SW_MAXIMIZE) EndFunc Is this correct? It doesn't report an error, but it doesn't maximize the window either. Edited February 10, 2006 by ksv247
MuffinMan Posted February 10, 2006 Posted February 10, 2006 It works for me when I use Internet Explorer to open a URL, but then again, and someone mentioned this upthread - you're running Explorer.exe, not the Acrobat executable. Have you tried letting IE open the PDF file?
PerryRaptor Posted February 10, 2006 Posted February 10, 2006 How about letting the operating system open the pdf file based on file association. Using the "Start /Max" through a console will open your documents in a maximized window. If you use "Start /Min" then Adobe will open in a smaller window and minimized to the taskbar. $HelpFile = @ScriptDir & "\Documentation\help.pdf" Run(@Comspec & " /C Start /Max " & $HelpFile,"", @SW_hide)
ksv247 Posted February 10, 2006 Author Posted February 10, 2006 Yes, it worked like you said. Func HB() Run("C:\Program Files\Internet Explorer\iexplore.exe " & @ScriptDir & "\Documentation\Help.pdf", "", @SW_MAXIMIZE) EndFunc "...open the pdf file based on file association" - This was my intention using explorer, but your idea was better. $HelpFile = @ScriptDir & "\Documentation\help.pdf" Run(@Comspec & " /C Start /Max " & $HelpFile,"", @SW_hide) ...works as well, maximizing the window AND using the default program for pdf files, thanks to all of you for your help. ksv
sksbir Posted February 10, 2006 Posted February 10, 2006 (edited) may be this wil work (sorry i can't try at this time): run ("RunDLL32.EXE shell32.dll,ShellExec_RunDLL myPDFDOC.pdf") Edited February 10, 2006 by sksbir
eltorro Posted February 11, 2006 Posted February 11, 2006 I have used this before: $helpfile=@ScriptDir & "\Documentation\Help.pdf" run("RunDLL32.EXE url.dll,FileProtocolHandler "&$helpfile) RunDLL32.exe will get the application associated with the extension and lauch it. Steve Regards, [indent]ElTorro[/indent][font="Book"] Decide, Commit, Achieve[/font]_ConfigIO.au3Language Translation --uses Google(tm) MsgBox Move XML wrapper UDF XML2TreeView Zip functionality Split your GUI Save Print ScreenZipPluginEdit In Place listviewSome of my scripts on Google code
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