Indigo Rose Software
  #1  
Old 2 Weeks Ago
bmn bmn is offline
Forum Member
 
Join Date: Aug 2009
Posts: 2
Running applications in sequence

Hi All,

I was wondering if you can run applications such as follow:
1- run one application such as ccleaner or something.
2- wait for the first application to finish the work, once its finished start another application in sequence and so forth.

is there a way to accomplish this?

cheers,
Reply With Quote
  #2  
Old 2 Weeks Ago
Scriptonite's Avatar
Scriptonite Scriptonite is offline
Indigo Rose Customer
 
Join Date: Oct 2009
Location: 127.0.0.1
Posts: 41
Use true in wait for return with File.Run

Code:
File.Run("MyProgram", "myargs", "", SW_SHOWNORMAL, true);
This will not allow the script to continue until the program running has completed.
__________________
User error: replace user and press any key to continue.
Reply With Quote
  #3  
Old 2 Weeks Ago
bmn bmn is offline
Forum Member
 
Join Date: Aug 2009
Posts: 2
oh thanks i will try it. is there a way in the script to run a program ans once its finished close it and start another program in the sequence?

cheers,
Reply With Quote
  #4  
Old 2 Weeks Ago
Scriptonite's Avatar
Scriptonite Scriptonite is offline
Indigo Rose Customer
 
Join Date: Oct 2009
Location: 127.0.0.1
Posts: 41
You can use this function after each process complete.

Code:
function EndProgram(Prog) 
processes = System.EnumerateProcesses();

for j, file_path in processes do
    file = String.SplitPath(file_path);
    if (String.Lower(file.Filename..file.Extension)) == Prog then
        System.TerminateProcess(j);
    end
end

end
Call with:
Code:
--program name should be lowercase
EndProgram("yourprogram.exe");
If the program doesn't finish running though i'm not sure it would be able to trigger this because AMS will not know that it's done.
__________________
User error: replace user and press any key to continue.
Reply With Quote
  #5  
Old 2 Weeks Ago
Dermot Dermot is offline
Indigo Rose Customer
 
Join Date: Apr 2004
Location: Vancouver, Canada
Posts: 1,520
All you need to do is
Code:
File.Run("MyProgram1", "myargs", "", SW_SHOWNORMAL, true);
File.Run("MyProgram2", "myargs", "", SW_SHOWNORMAL, true);
File.Run("MyProgram3", "myargs", "", SW_SHOWNORMAL, true);
..and so on
__________________
Dermot

AMS Add-ons - xDialog.com

A complex system that does not work is invariably found to have evolved from a simpler system that worked just fine.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



All times are GMT -6. The time now is 08:30 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Copyright © 2000 - 2009 Indigo Rose Corporation. All rights reserved.
Indigo Rose Software