| View previous topic :: View next topic |
| Author |
Message |
instantrunoff
Joined: 13 Jan 2008 Posts: 81
|
Posted: Thu Jun 05, 2008 4:23 pm Post subject: Simulate Run from Shell? |
|
|
I have a simple command
| Code: | | >^]::Run D:\Desktop\IP Division Calendar.pdf |
That always messes up my PDF program, PDF XChange Viewer in that the toolbars and other view settings reset to the defaults. The following variations result in the same problem:
- using quotes around the path(s)
- specifying the exe and then the pdf
- specifying the working directory of the pdf exe
- working directory as the appdata folder
- working directory as exe folder one level up
- creating a shortcut and trying to run that
Everything I've tried, even running a shortcut (.lnk) from my AHK script, results in the same issue but opening the pdf or shortcut from the shell does not demonstrate this problem. How can AHK simulate a run from the shell?[/code] |
|
| Back to top |
|
 |
engunneer
Joined: 30 Aug 2005 Posts: 6847 Location: Pacific Northwest, US
|
Posted: Thu Jun 05, 2008 4:34 pm Post subject: |
|
|
the closest to what explorer does would be (I think)
| Code: |
>^]::Run %PDFprogram% D:\Desktop\IP Division Calendar.pdf, D:\Desktop\
|
or
| Code: |
>^]::Run %comspec% /c %PDFprogram% D:\Desktop\IP Division Calendar.pdf, D:\Desktop\
|
You have to fill out the PDF program part.
If you want to be sure you are making your command line the exact same as doubleclicking the file, you can look at the filetype settings in Tools|Folder Options in Explorer to see exactly what it uses for files of type PDF.
You may also need to play with RunAs? _________________
Unless otherwise noted, all code is untested.
Common Answers: 1.(Loops, Viruses, etc.) 2. Search 3.RTFM |
|
| Back to top |
|
 |
instantrunoff
Joined: 13 Jan 2008 Posts: 81
|
Posted: Thu Jun 05, 2008 4:47 pm Post subject: |
|
|
| engunneer wrote: | the closest to what explorer does would be (I think)
| Code: |
>^]::Run %PDFprogram% D:\Desktop\IP Division Calendar.pdf, D:\Desktop\
|
|
Wow. That worked. Thanks! |
|
| Back to top |
|
 |
|