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 

Application directory & Auto start

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



Joined: 29 Dec 2006
Posts: 123
Location: Australia

PostPosted: Thu Jun 19, 2008 3:20 am    Post subject: Application directory & Auto start Reply with quote

I have an application on a USB memory drive and it works by calling the location by Using

Code:
 %A_WorkingDir%


Now when I create a key in the registry the hot key detection program loads but it looks in another directory other that the USB one. In Basic I can use the command "Application.Path" which tells the application where it is. As it is on a USB memory device the drive letter may change.

I have not found an equivenent command as
Code:
Run, %A_WorkingDir%\Application.exe
even when the hotkey detection script is in the same folder will not find Application.exe.

It works if I create a shortcut or even a Autorun script

Any ideas welcomed.

Also I am still looking for a autorun method that will autostart a application on USB insertion the best so far is

Code:

[Autorun]
Open=Program.exe
icon=Program.exe
label=Program Drive
action=Program


That gets it to the option window. It seems to work in all instances Sometimes the Autoplay needs setting.

For a CD its different it runs merrily away. I cannot quite get the same effect with a usb memory device.

Terry
_________________
(The guy from Oz)
Back to top
View user's profile Send private message
ttrickyy



Joined: 18 Jun 2008
Posts: 20

PostPosted: Thu Jun 19, 2008 5:21 am    Post subject: Re: Application directory & Auto start Reply with quote

TeeTwo wrote:

Also I am still looking for a autorun method that will autostart a application on USB insertion the best so far is...

For a CD its different it runs merrily away. I cannot quite get the same effect with a usb memory device.

Autorun for CD drives works differently than autorun for removable devices. http://en.wikipedia.org/wiki/Autorun#How_Explorer_recognizes_AutoRun_capability gives all of the different classes of autorun. Notice how DRIVE_REMOVABLE (what your flash drive falls under) is disabled by default. This is why U3 installs a virtual CD drive, in order to autorun an application in Windows.


For the rest of your problem...
Code:
%A_ScriptDir%
?
--tested in .ahk and .exe to work correctly
_________________
ttrickyy
Back to top
View user's profile Send private message
TeeTwo



Joined: 29 Dec 2006
Posts: 123
Location: Australia

PostPosted: Thu Jun 19, 2008 1:52 pm    Post subject: Reply with quote

I appreciate the heads up and links. Really a U3 should only be a standard USB device with a program on it. I have heard of people reformating one to see what happens and lose the Autostart feature. In Australia I have not come across one yet

Terry
_________________
(The guy from Oz)
Back to top
View user's profile Send private message
Display posts from previous:   
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