topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Thursday March 28, 2024, 1:34 pm
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Author Topic: [Idee] GroupStarter  (Read 10809 times)

AbteriX

  • Charter Honorary Member
  • Joined in 2005
  • ***
  • Posts: 1,149
    • View Profile
    • Donate to Member
[Idee] GroupStarter
« on: July 10, 2007, 06:14 AM »
I'am on the search for an app to start several programs as an group.

Like:

Wait x sec ; Options ; Program ; Optional Parameter ; Optional start path ; Optional message box

0 ;; Total Commander.exe ; ; ; "TC started"
2 ;; AutoHotkey.exe
2 ;; Reminder.exe ; ; ; "Reminder started, look in the TNA"
1 ;; Notepad.exe ; C:\Notice.txt


After that the GroupStarter.exe should close it self.
No TrayIcon please.
No registry, INI instead.
Should work with relative paths and system vars.
"options" is for later use. Or for this "start min, max.." thing.

Did anyone know such an tool?

app103

  • That scary taskbar girl
  • Global Moderator
  • Joined in 2006
  • *****
  • Posts: 5,884
    • View Profile
    • Donate to Member
Re: [Idee] GroupStarter
« Reply #1 on: July 10, 2007, 06:38 AM »
I had a discussion with Jah about something very similar to this.

He made a tool that works like this:

You create a text file with the path to each file or program you want to launch. One per line.

They are launched in order.

The application accepts 2 command line parameters: the first is how many seconds you want it to wait before it begins launching what is on your list and the second is how many seconds you want it to wait between items.

If you need to launch something with command line parameters, you can configure a shortcut file and add the path to the shortcut.lnk to the list rather than the path to the application itself.

It has no tray icon, no window, doesn't use the registry...just does what it does and exits. (seems to have high cpu usage for some reason, though)

I have a copy of it but I can't distribute it without his permission, and he isn't talking to me. If you would like to try it, you'll have to PM him and ask him to share it.

AbteriX

  • Charter Honorary Member
  • Joined in 2005
  • ***
  • Posts: 1,149
    • View Profile
    • Donate to Member
Re: [Idee] GroupStarter
« Reply #2 on: July 10, 2007, 09:13 AM »
Thanks app103

Just before i access my AHK.chm i think i could take an google search again and found:

http://www2.webng.co...un/MultiRunInfo.html
http://www.geocities...tros/delayrun_en.htm

justice

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,898
    • View Profile
    • Donate to Member
Re: [Idee] GroupStarter
« Reply #3 on: July 10, 2007, 09:16 AM »
Shouldn't be too hard to make for example with AutoHotkey, if it was based on text files. However it would be so much nicer if you could drag applications to the "groupstarter" and manipulate groups from within a program. ;)

Multirun looks promising though, might be useful for my dj setup (traktor, icecast, winamp,shoutcase,browser) or web development ritual. Nice find.

AbteriX

  • Charter Honorary Member
  • Joined in 2005
  • ***
  • Posts: 1,149
    • View Profile
    • Donate to Member
Re: [Idee] GroupStarter
« Reply #4 on: July 10, 2007, 09:56 AM »
I need only an exe who parse an ini and start the apps listed there. No GUI. I would like to modify the ini in notepad.
Maybe i go back to an batch.cmd .... but i thought there would be a smarter way.
Let's see was google brings us this night.

AbteriX

  • Charter Honorary Member
  • Joined in 2005
  • ***
  • Posts: 1,149
    • View Profile
    • Donate to Member
Re: [Idee] GroupStarter
« Reply #5 on: July 10, 2007, 09:58 AM »
> Shouldn't be too hard to make for example with AutoHotkey,

Yes i have definitely to learn how to store/read settings in an ini  :-[

AbteriX

  • Charter Honorary Member
  • Joined in 2005
  • ***
  • Posts: 1,149
    • View Profile
    • Donate to Member
Re: [Idee] GroupStarter
« Reply #6 on: July 10, 2007, 05:13 PM »
My first script to solve my problem.

I would like to call this version an alpha build. Test on your own risk.

Tomorrow we see forward.

Any suggestions, comments and translating to English is welcome.

The AHK script:

;REM  DelayLauncher, 2007 by Stefan
;REM  Simple AHK script (www.autohotkey.com)
;REM  to start one or more applications listed in an ini file, if wanted with delay.
;REM 
;REM  Purpose: start an group of applications and/or start your programs in the autostart folder with an delay.
;REM 
;REM  Syntax of the DelayLauncher.ini file:
;REM  Seconds to wait, Target (Application plus parameters), Workingdir, launch state
;REM  For example:
;REM  2, Notepad notice.txt,,max
;REM 
;REM  All parameters could be empty. Only "Target" is needed ;-) and the comas for empty parameters if an parameter follows
;REM 
;REM  To take an application out of the launching put an '#' in front of the line
;REM  For example:
;REM  #2, Notepad notice.txt,,max
;REM 
;REM  To execute the applications the AHK command "Run" is used.
;REM  See www.AutoHotkey.com Help file for RUN command:
;REM 
;REM  Run, Target [, WorkingDir, Max|Min|Hide|UseErrorLevel]
;REM 
;REM  Target
;REM  A document, URL, executable file (.exe, .com, .bat, etc.), shortcut (.lnk), or system verb to launch (see remarks).
;REM  If Target contains any commas, they must be escaped as shown three times in the following example:
;REM  Run rundll32.exe shell32.dll`,Control_RunDLL desk.cpl`,`, 3  ; Opens Control Panel > Display Properties > Settings
;REM  To pass parameters, add them immediately after the program or document name.
;REM  If a parameter contains spaces, it is safest to enclose it in double quotes (even though it may work without them in some cases).
;REM   
;REM  WorkingDir
;REM  The working directory for the launched item. Do not enclose the name in double quotes even if it contains spaces.
;REM  If omitted, the script's own working directory (A_WorkingDir) will be used. 
;REM 
;REM  Max|Min|Hide
;REM  If omitted, Target will be launched normally. Alternatively, it can contain one or more of these words:
;REM  Max: launch maximized
;REM  Min: launch minimized
;REM  Hide: launch hidden (cannot be used in combination with either of the above)
 

Loop, read, DelayLauncher.ini              ;The INI who stores the applications list to launch
{
    Loop, parse, A_LoopReadLine, CSV
    {
    VAR%A_Index% = %A_LoopField%
    }
    IfInString, VAR1, #                   ;If this character is found skip the launch of this application
      continue
    If VAR1 is not integer                ;If the delay time is omitted (app is in Var1) shift the app name to Var2
       VAR2 = %VAR1%
   T := VAR1 * 1000                       ;AHK count with milliseconds, we multiply the user input '2' with 1000 to get 2000 ms = 2sec
   Sleep, %T%
        ;Test the command line:
        ;MsgBox, 4, Test, Wait for %VAR1% Seconds - RUN now %VAR2% %VAR3% %VAR4%   `n`nContinue?
          ;IfMsgBox, No
          ;return
   Run, %Var2% , %Var3% , %Var4% UseErrorLevel    ;Launch the app
        if ErrorLevel = ERROR                     ;If an error occur continue
        MsgBox, 20,Mistake,Error with application: %VAR2% `nPlease check the settings.  `n`nContinue the other applications?
            IfMsgBox, No
            return
}
Exit
return

;


The INI file (save as "DelayLauncher.ini"):
calc
#1,Paint
1, Notepa,,min
2, Notepad notice.txt,,max

justice

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,898
    • View Profile
    • Donate to Member
Re: [Idee] GroupStarter
« Reply #7 on: July 10, 2007, 05:40 PM »
good job. idea: instead of the ini filename, use %1%, then use your own extensino .gst for example, and then you can drag and drop .gst files on your script to execute them. this way you can use multiple .gst files. And associate .gst with your executable for double clicking.

AbteriX

  • Charter Honorary Member
  • Joined in 2005
  • ***
  • Posts: 1,149
    • View Profile
    • Donate to Member
Re: [Idee] GroupStarter
« Reply #8 on: July 11, 2007, 12:31 AM »
good job. idea: instead of the ini filename, use %1%,
then use your own extensino .gst for example,
and then you can drag and drop .gst files on your script to execute them.
this way you can use multiple .gst files.
And associate .gst with your executable for double clicking.
1.) K.I.S.S. ...
...and portable => NO!!! Registry mess up
2.) i can't d&d in TC
3.) but %1% is good idea to be flexible! (not only d&d but start like "EXE PARA" , no matter what extension)
4.) i will disable the TNA icon


AbteriX

  • Charter Honorary Member
  • Joined in 2005
  • ***
  • Posts: 1,149
    • View Profile
    • Donate to Member
Re: [Idee] GroupStarter
« Reply #9 on: July 11, 2007, 03:17 AM »
New
- alternative use of INI file as parameter instead of default DelayLauncher.ini
- little Debug message
- MsgBox improvements
- No Tray Icon
- still to do some little improvements, testings with blanks, clean up the code and such, but here is DelayLauncher v0.2
(need an other/better name???)

;REM  DelayLauncher, 2007 by Stefan
;REM  Simple AHK script (www.autohotkey.com)
;REM  to start one or more applications listed in an ini file, if wanted with delay.
;REM
;REM  Purpose: start an group of applications and/or start your programs in the autostart folder with an delay.
;REM
;REM  Syntax of the DelayLauncher.ini file:
;REM  Seconds to wait, Target (Application plus parameters), Workingdir, launch state
;REM  For example:
;REM  2, Notepad notice.txt,,max
;REM
;REM  All parameters could be empty. Only "Target" is needed ;-) and the comas for empty parameters if an parameter follows
;REM
;REM  To take an application out of the launching put an '#' in front of the line
;REM  For example:
;REM  #2, Notepad notice.txt,,max
;REM
;REM  To execute the applications the AHK command "Run" is used.
;REM  See www.AutoHotkey.com Help file for RUN command:
;REM
;REM  Run, Target [, WorkingDir, Max|Min|Hide|UseErrorLevel]
;REM
;REM  Target
;REM  A document, URL, executable file (.exe, .com, .bat, etc.), shortcut (.lnk), or system verb to launch (see remarks).
;REM  If Target contains any commas, they must be escaped as shown three times in the following example:
;REM  Run rundll32.exe shell32.dll`,Control_RunDLL desk.cpl`,`, 3  ; Opens Control Panel > Display Properties > Settings
;REM  To pass parameters, add them immediately after the program or document name.
;REM  If a parameter contains spaces, it is safest to enclose it in double quotes (even though it may work without them in some cases).
;REM
;REM  WorkingDir
;REM  The working directory for the launched item. Do not enclose the name in double quotes even if it contains spaces.
;REM  If omitted, the script's own working directory (A_WorkingDir) will be used.
;REM
;REM  Max|Min|Hide
;REM  If omitted, Target will be launched normally. Alternatively, it can contain one or more of these words:
;REM  Max: launch maximized
;REM  Min: launch minimized
;REM  Hide: launch hidden (cannot be used in combination with either of the above)


#NoTrayIcon                               ;disable the view of the AHK icon


INIfile = %1%                             ;Use the INI file given as parameter.
If ("%1%" = "")                           ;If no ini file parameter is given on the command line
   INIfile = DelayLauncher.ini            ;use the standard INI DelayLauncher.ini


If 2 contains debugit                     ;Debug mode: see what the script will do
 MsgBox, 64,Debug DelayLauncher command line, Parameter (%0%):`t%1% %2% %3%`nINIfile:`t`t%inifile% `nScript Working Dir: %A_ScriptDir%



Loop, read, %INIfile%                     ;The INI who stores the applications list to launch
{
    Loop, parse, A_LoopReadLine, CSV
    {
    VAR%A_Index% = %A_LoopField%
    }
    IfInString, VAR1, #                   ;If this character is found skip the launch of this application
      continue
    If VAR1 is not integer                ;If the delay time is omitted (app is in Var1) shift the app name to Var2
       VAR2 = %VAR1%
   T := VAR1 * 1000                       ;AHK count with milliseconds, we multiply the user input '2' with 1000 to get 2000 ms = 2sec
   Sleep, %T%                             ;Pause
        ;Test the command line:
        ;MsgBox, 4, Test, Wait for %VAR1% Seconds - RUN now %VAR2% %VAR3% %VAR4%   `n`nContinue?
          ;IfMsgBox, No
          ;return
        If (%VAR3% = "")                ;for .lnk error handling
        VAR3 = %A_ScriptDir%
   Run, %Var2% , %Var3% , %Var4% UseErrorLevel    ;Launch the app
        if ErrorLevel = ERROR                     ;If an error occur continue
        MsgBox, 20,DelayLauncher Warning,Error while launching this application: `nApp name:`t%VAR2%, `nWorking Dir:`t%VAR3%, `nState:`t`t%VAR4%, `n`t%VAR5% `n`t%VAR6% `nDelay:`t%VAR1% seconds`n`nPlease check the settings in the INI %INIfile%.  `nI give up :(`nContinue launching the other applications?
            IfMsgBox, No
            return
}
Exit
return
;
-v0.2

AbteriX

  • Charter Honorary Member
  • Joined in 2005
  • ***
  • Posts: 1,149
    • View Profile
    • Donate to Member
Re: [Idee] GroupStarter
« Reply #10 on: July 14, 2007, 02:18 PM »
As always  :(

Wanting to improve my code this weekend (will do perhaps)
but while googling smtg i found LaunchAT , at little 20kB (8kB UPX) program launcher
which do that what i want (not tested widely, want to share before forget it) and maybe more.

http://81.56.229.95/...aunchat/launchat.htm
http://debrock.org/

"ReadMe"
;
; LaunchAt.ini - Configuration file for LaunchAt.exe (http://debrock.org/launchat/)
; LaunchAt.exe parses this file then launches listed programs, following a time-line
; defined by all the "Delay=" values.
;
; Syntax for this conf file:
;
; Comments begin with a semi-colon ( ; )
; Environment variables are expanded: %SystemRoot% will be expanded as C:\WINDOWS
;
; [Notepad] ;Each app description starts with a section definition. It must be unique within this conf file.
;
; App=Full path and name of the application to be launched. LaunchAt.exe takes care of your PATH env var.,
;
; Param=[optional command-line parameters] ; Put here any options needed by the application to be launched.
;
; Delay=delay before launch, in seconds.
;
; Disabled=0/1 used to temporary disabling this topic
;
; Show=How to display the window. Possible values are
;   0: Hides the windows
;   1: Show normal (default)
;   2: Show minimized
;   3: Show maximized
;   4: Show normal without activating it
;   7: Show minimized without activating it
;
; Example:
;[Notepad]
;App=notepad.exe
;Param="\Sample Text File opened via LaunchAt.txt" ; Need quotes, because of spaces in file name.
;Delay=0 ; seconds after startup of LaunchAt.

[Notepad with environment var]
App=%SystemRoot%\notepad.exe
Param="%ProgramFiles%\Sample Text File located in ProgramFiles opened via LaunchAt.txt"
Delay=5 ; seconds after startup of LaunchAt.
Show=2 ; minimized


launchat.png
« Last Edit: July 14, 2007, 02:21 PM by AbteriX »