AutoHotkey Community

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

All times are UTC [ DST ]




Post new topic Reply to topic  [ 15 posts ] 
Author Message
PostPosted: April 10th, 2006, 8:03 pm 
Offline

Joined: April 7th, 2006, 10:42 pm
Posts: 39
Location: Thailand
How to add a "load on startup" option ?

Also, how to let a scrip run "without" to show up in the system tray ?

Anybody knows how ?

Thanks
:)
Rene


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 10th, 2006, 8:28 pm 
Offline

Joined: December 22nd, 2005, 7:43 pm
Posts: 245
As BoBo would say, "Sounds suspicious... :evil: "

Look at #NoTrayIcon. There isn't a command to load on startup, but you can dump the file into the start up folder.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 10th, 2006, 8:41 pm 
Offline

Joined: December 16th, 2004, 11:45 pm
Posts: 89
Below script will add and later launch the notepad at the startup.

Code:
RegWrite, REG_SZ, HKEY_LOCAL_MACHINE, SOFTWARE\Microsoft\Windows\CurrentVersion\Run, C:\Windows\System32\Notepad.exe

_________________
Image
"the things we touch have no permanence. my master would say: there is nothing we can hold onto in this world.. only by letting go can we truly possess what is real..."


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 10th, 2006, 8:54 pm 
Offline

Joined: March 24th, 2005, 11:50 am
Posts: 398
Location: germany
I don't think, that it is a good idea, to show how to start scripts hidden and automatically, too much script-kiddies out there


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 10th, 2006, 9:31 pm 
Offline

Joined: December 16th, 2004, 11:45 pm
Posts: 89
True.

I can only hope that he had a good intention for its usage.
As a systems administrator, I have written many scripts that had to be run at the startup without the operator knowing it. So the system is functional and as secure as possible at the same time.

_________________
Image
"the things we touch have no permanence. my master would say: there is nothing we can hold onto in this world.. only by letting go can we truly possess what is real..."


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 10th, 2006, 9:40 pm 
Offline

Joined: April 7th, 2006, 10:42 pm
Posts: 39
Location: Thailand
Hm so, no easy way to do such a standard thing ?
Most of the tray tools I use have,
"Start at Windows startup/logon"
and some also
"Show in system tray"
it is a usual configuration option... :?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 11th, 2006, 9:11 am 
Offline

Joined: December 27th, 2005, 1:46 pm
Posts: 6837
Location: France (near Paris)
midiworks wrote:
Hm so, no easy way to do such a standard thing ?
Isn't Pasukun's way easy enough? Or is it FileCopy or FileMove commands hard to master? You have the solutions, and they are (mostly) those used by the softwares you mention.

_________________
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: April 11th, 2006, 10:40 am 
Offline

Joined: April 7th, 2006, 10:42 pm
Posts: 39
Location: Thailand
sure, that would be easy to do, but this is not the point.
I would like to have an option on the gui, so the user can set up things by himself.

#NoTrayIcon is an easy function, but tweaking the registry don't seem to be very elegant for me.

all I want, are 2 checkboxes...


thanks to all of you, for your suggestions. :)

:D
René


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 11th, 2006, 10:54 am 
Offline

Joined: December 27th, 2005, 1:46 pm
Posts: 6837
Location: France (near Paris)
midiworks wrote:
but tweaking the registry don't seem to be very elegant for me.
:?: Then use the start up menu option.
Where are you stuck? You don't know how to make a GUI?

_________________
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: April 11th, 2006, 11:25 am 
Offline

Joined: April 7th, 2006, 10:42 pm
Posts: 39
Location: Thailand
I had tried the gui-builder, a very nice and clever program,
but true, I have not made any tool with gui yet.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 11th, 2006, 11:50 am 
Offline

Joined: March 24th, 2005, 11:50 am
Posts: 398
Location: germany
I think, you have to read the gui section of the fine Manual, first. Test the example scripts and try to make some on your own.
http://www.autohotkey.com/docs/commands/Gui.htm


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 11th, 2006, 12:53 pm 
I think after learning the basics, like "Tutorial (quick start)", on the Contents section of the AHK help file. It is easiest to then search the index and look at all the commands. Theres some stuff I cant find using the index though, and they can be found using the search option. Anywas, I guess what I'm trying to say is the manual is great, but you have to know how to search it. Even then I still find myself asking question's on the forums all the time :lol:


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: April 11th, 2006, 12:54 pm 
Offline

Joined: April 7th, 2006, 10:42 pm
Posts: 39
Location: Thailand
http://www.autohotkey.com/forum/viewtopic.php?t=3950
Dmitry wrote:
New version of Autorun.ahk. Creates a shorcut in Windows Startup folder instead of a Registry record.
Code:
;
; AutoHotkey Version: 1.0.35.10
; Language:       English
; Platform:       WinXP
; Author:         Dmitry B. Lyudmirsky <lud@skpress.ru>
;
; Script Function:
;   Save as Autorun.ahk and put into your script dir.
;    To provide Autorun capability
;   simply place a line "#Include Autorun.ahk"
;    anywhere in your script's tray menu declaration
;
AutorunMenuItemName = Autorun
SubKey name
SF = %A_Startup% ; Startup Folder
LF = %SF%\%A_ScriptName%.lnk ; LinkFile

Menu TRAY, Add, %AutorunMenuItemName%, AutorunTune
AutorunTune: ; subroutine have conditional return to deceive the compiler
   if AutorunInit
   {
      if AutorunOn
      {
         FileDelete %LF%
         AutorunOn := ErrorLevel
         if !AutorunOn
            Menu, TRAY, Uncheck, %AutorunMenuItemName%
         return
      }
      FileCreateShortcut %A_ScriptFullPath%, %LF%, %A_ScriptDir%
      AutorunOn := !ErrorLevel
      if AutorunOn
         Menu, TRAY, Check, %AutorunMenuItemName%
      return ; end of subroutine if AutorunInit
   }
; initializing section
AutorunInit = 1
FileGetShortcut %LF%, ScrPath
AutorunOn := !ErrorLevel
if AutorunOn
{
   IfNotEqual ScrPath, A_ScriptFullPath
   { ; update record in case of script file was moved
      FileCreateShortcut %A_ScriptFullPath%, %LF%, %A_ScriptDir%
      AutorunOn := !ErrorLevel
   }
   if AutorunOn
      Menu, TRAY, Check, %AutorunMenuItemName%
}

8)


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 11th, 2006, 1:05 pm 
I dont understand that script at all. LOL I'm sure there could be an easier way by just using Filecopy, Filemove, and use the
%A_StartMenuCommon% variable. How would you make the menu tray text change when you have it set to run on startup then when it is switch to not run on startup? To get rid of it from startup you could just use "FileDelete" "%A_StartMenuCommon%Script/File.name"


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: April 11th, 2006, 1:13 pm 
Offline

Joined: December 27th, 2005, 1:46 pm
Posts: 6837
Location: France (near Paris)
That's exactly what this script does, with a refinement: instead of copying physically the whole script (which may be bad if it depends on files on its directory), it creates a shortcut to it: FileCreateShortcut. Of course, .ahk files must be associated to AutoHotkey's exe.

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


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

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 14 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