AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Simulate Run from Shell?

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
instantrunoff



Joined: 13 Jan 2008
Posts: 81

PostPosted: Thu Jun 05, 2008 4:23 pm    Post subject: Simulate Run from Shell? Reply with quote

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
View user's profile Send private message Visit poster's website
engunneer



Joined: 30 Aug 2005
Posts: 6847
Location: Pacific Northwest, US

PostPosted: Thu Jun 05, 2008 4:34 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
instantrunoff



Joined: 13 Jan 2008
Posts: 81

PostPosted: Thu Jun 05, 2008 4:47 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group