topbanner_forum
  *

avatar image

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

Login with username, password and session length
  • Thursday December 12, 2024, 2:26 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: IDEA: Run Before / After something  (Read 16446 times)

justice

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,898
    • View Profile
    • Donate to Member
IDEA: Run Before / After something
« on: April 24, 2007, 03:40 AM »
Some software allows you to run a command before or after the software itself is run. For example: Syncback allows you to run a command so that you can do something with the backup. I would be interested in using a program that does this on a more general basis:

For example I could set up a "link" to download the newest  Keepass database from ftp before running the Keepass program (synchronisation) and upload it again afterwards.

ideally
Ideally It would be good if it worked with a list of entries, each entry specifying program and the commands it should run before / after. This is easier to maintain then something decentralised.
Ideally it would still allow you to run a program the usual way (run Keepass from the start menu and FARR). I guess it would intercept the run call or modify the shortcut or some other clever way.
I guess that some people would want to run more than one command, although of course you could just run a script or batch file.

Hopefully this sparks someone's interest or someone could point me to a similar program.

Thanks!
« Last Edit: April 24, 2007, 06:35 AM by justice »

lanux128

  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 6,277
    • View Profile
    • Donate to Member
Re: IDEA: Run Before / After something
« Reply #1 on: May 21, 2007, 12:14 AM »
there used to be a program called Omni Shortcut that is able to do this but i can't find it anymore.. however for simple, sequential execution of programs, i use Batchrun.. btw, this freeware is no longer in active development.. :huh:


https://www.donation...dex.php?topic=6492.0

also, there's always the "Start /w" command.. :)
To start programs sequentially in Windows, create a text file containing the following lines:
start /w <program1.exe>
start /w <program2.exe>
start /w <program3.exe>
<additional lines as necessary>

Save the text file with a .bat extension.
http://support.microsoft.com/kb/198044


justice

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,898
    • View Profile
    • Donate to Member
Re: IDEA: Run Before / After something
« Reply #2 on: May 21, 2007, 07:01 AM »
Thanks Lanux128. An alternative also would be to make an autohotkey script and use RunWait. I was hoping there would have been a program that would detect program x was started, instead started y, then started x, and afterwards start z.
The benefit of this would be that I can just keep running X as normal, or via file associations etc.

However the more I think about it, the more this seems to be impossible, also Windows might not like it, basically you're creating a dodgy piece of software. :)

skrommel

  • Fastest code in the west
  • Developer
  • Joined in 2005
  • ***
  • Posts: 933
    • View Profile
    • 1 Hour Software by skrommel
    • Donate to Member
Re: IDEA: Run Before / After something
« Reply #3 on: May 22, 2007, 08:20 PM »
:) Here's something that may work.

PauseProcess - Pause a program and run other programs before and after.

Command line:
  PauseProcess.exe "<program to pause>" ["<program to run before>" "<program to run after>"]
Example:
  PauseProcess.exe "Notepad.exe" "Pbrush.exe" "Calc.exe"

Uses PauseP.exe by Daniel Turion at http://www.codeproje...m/threads/pausep.asp

You'll find the downloads and more info at 1 Hour Software by Skrommel.

It would be possible to make a real interception using hooks, but a pause is much simpler.
The author of PauseP.exe warns that it may crash multithreaded apps.

Skrommel
« Last Edit: May 22, 2007, 08:24 PM by skrommel »