AutoHotkey Community

It is currently May 27th, 2012, 11:15 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 12 posts ] 
Author Message
PostPosted: March 2nd, 2006, 8:05 pm 
How do I install my ahk exe in another computer's startup folder directly upon executing it from anywhere. Like using fileinstall or something. I will email my executable and when they open it, I want it to cpoy itself to their startup folder. Does the startup folder reside in the same location for all Win OS's?


Report this post
Top
  
Reply with quote  
PostPosted: March 2nd, 2006, 8:42 pm 
Online
User avatar

Joined: December 26th, 2005, 4:40 pm
Posts: 8776
Dear quest,

you may try this

Code:
StartupFolder= %A_StartMenucommon%\Programs\Startup
if A_scriptDir != %StartupFolder%
FileCopy, %A_ScriptFullpath%, %StartupFolder%

;Rest of your code from here



Regards, :)

_________________
URLGet - Internet Explorer based Downloader
StartEx - Portable Shortcut Link


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 2nd, 2006, 9:29 pm 
For known (security) reason any usefull mail program will block such an effort. Kinda super suspicious request :evil:


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: March 2nd, 2006, 10:08 pm 
Thanks you goyyah.


Quote:
For known (security) reason any usefull mail program will block such an effort. Kinda super suspicious request


Why is sending my ahk.exe suspicious... I thought thats why the capabiltly is there, so ahk doesnt need to be installed on the computer that will be running the script. Automation: users do not even have to launch the script...already launched when the computer gets turned on... isnt this the point?

anyway thank you for your concern, but when emailing, i take off the extension, then rename it on the other side... which would defeat the purpose of having total automation, but i requested this because i didnt know if all OS's kept the startup folder in the same place.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: March 2nd, 2006, 10:20 pm 
Offline

Joined: December 30th, 2005, 5:01 pm
Posts: 448
Or use this:
A_StartupCommon: The full path and name of the Startup folder in the all-users Start Menu.
(This directory will not be the same in every OS language)


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 3rd, 2006, 5:35 am 
Peter wrote:
Or use this:
A_StartupCommon: The full path and name of the Startup folder in the all-users Start Menu.
(This directory will not be the same in every OS language)


    :oops: I overlooked it :!:


Code:
StartupFolder= %A_Startupcommon%\Programs\Startup
if A_scriptDir != %StartupFolder%
FileCopy, %A_ScriptFullpath%, %StartupFolder%

;Rest of your code from here


Thanks Peter, :)


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: March 3rd, 2006, 3:34 pm 
Offline

Joined: December 27th, 2005, 1:46 pm
Posts: 6837
Location: France (near Paris)
Uh? No! Drop the StartupFolder variable init (first line) and replace it with A_StartupCommon...

Note: I understand BoBo's concern, a malicious program may want to do that... But there are legitimate uses, of course.

_________________
Image vPhiLho := RegExReplace("Philippe Lhoste", "^(\w{3})\w*\s+\b(\w{3})\w*$", "$1$2")


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 3rd, 2006, 9:18 pm 
Online
User avatar

Joined: December 26th, 2005, 4:40 pm
Posts: 8776
Code:
if A_scriptDir != %A_StartupCommon%
FileCopy, %A_ScriptFullpath%, %A_StartupCommon%


@PhiLho: Thanks! :)
@Goyyah: You're DUMB! :shock:

_________________
URLGet - Internet Explorer based Downloader
StartEx - Portable Shortcut Link


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 4th, 2006, 12:33 am 
Thanks everyone. Quick follow-up question, just for my own learning, what does != do? Ive never seen this yet in ahk. Im thinking same as <> ?


Quote:
if A_scriptDir != %A_StartupCommon%


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: March 4th, 2006, 1:08 am 
Offline

Joined: August 24th, 2005, 5:17 pm
Posts: 1237
Correct, it's just an alternative syntax (it's in the help file somewhere). The exclamation mark is a logical "not". I prefer this syntax myself as it translates more logically (in my mind).


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 4th, 2006, 1:26 am 
thanks for the clarification Evl.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: March 4th, 2006, 7:44 am 
Online
User avatar

Joined: December 26th, 2005, 4:40 pm
Posts: 8776
Dear quest,

Quote:
= == <> !=
Equal, case-sensitive-equal, and not-equal. The operators != and <> are identical in function. The == operator behaves identically to = except when either of the inputs is not a number, in which case == is always case sensitive and = is always case insensitive. By contrast, <> and != obey StringCaseSense. Note: A quoted literal string such as "55" is always considered non-numeric in this context.


I am used to != in a different programming language and so I've been sticking to it.

Regards, :)

_________________
URLGet - Internet Explorer based Downloader
StartEx - Portable Shortcut Link


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 12 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: BrandonHotkey, Yahoo [Bot] and 10 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group