Program that runs other programs, then shuts down?

Any other tech-related topics
Post Reply
Message
Author
bzl333
Posts: 167
Joined: Wed Jan 12, 2011 3:11 pm

Program that runs other programs, then shuts down?

#1 Post by bzl333 » Sun Feb 24, 2013 9:50 am

Hi,
was trying to do this with some batch files but i don't know enough to write them correctly i guess.

was just looking for a program that would run several other programs(their command line versions i guess are all thats possible?) stuff like CCleaner, BleachBit, and then maybe a defrag program - one after the other in sequence, and then when they are done shut down the computer.

User avatar
guinness
Posts: 4118
Joined: Mon Aug 27, 2007 2:00 am
Contact:

Re: Program that runs other programs, then shuts down?

#2 Post by guinness » Sun Feb 24, 2013 10:29 am

Search for Shutdown.
Added 179 Applications: Portable

User avatar
SYSTEM
Posts: 1969
Joined: Sat Jul 31, 2010 1:19 am
Location: Helsinki, Finland

Re: Program that runs other programs, then shuts down?

#3 Post by SYSTEM » Sun Feb 24, 2013 10:59 am

It is indeed possible with a batch file, provided that each program closes when it's done.

Something like:

Code: Select all

C:\path\to\program.exe /AUTO
E:\path\to\another\program.exe

REM this shuts down the computer
C:\Windows\System32\shutdown.exe /s /t 0
My YouTube channel | Release date of my 13th playlist: August 24, 2020

bzl333
Posts: 167
Joined: Wed Jan 12, 2011 3:11 pm

Re: Program that runs other programs, then shuts down?

#4 Post by bzl333 » Mon Feb 25, 2013 9:46 am

guinness wrote:Search for Shutdown.
thanks, it takes a while to wade thru them. always get sidetracked on this site.

SYSTEM wrote:It is indeed possible with a batch file, provided that each program closes when it's done.

Something like:

Code: Select all

C:\path\to\program.exe /AUTO
E:\path\to\another\program.exe

REM this shuts down the computer
C:\Windows\System32\shutdown.exe /s /t 0


oki, i had this:

ECHO OFF

CALL BleachBit_console.bat
CALL ccleaner.bat
and it would pause after the first one for some reason. i don't know any of this
stuff, just tried to pick up a few clues from that stackoverflow site i think it was but
they didn't address this specifically, where one program starts and finishes and then the next one starts and finishes.

i'll try your code there next :)

User avatar
SYSTEM
Posts: 1969
Joined: Sat Jul 31, 2010 1:19 am
Location: Helsinki, Finland

Re: Program that runs other programs, then shuts down?

#5 Post by SYSTEM » Mon Feb 25, 2013 10:10 pm

bzl333 wrote: oki, i had this:

ECHO OFF

CALL BleachBit_console.bat
CALL ccleaner.bat
and it would pause after the first one for some reason. i don't know any of this
stuff, just tried to pick up a few clues from that stackoverflow site i think it was but
they didn't address this specifically, where one program starts and finishes and then the next one starts and finishes.

i'll try your code there next :)
CALL is supposed to return control to the parent script when the child script has been run, so your example should have worked. Are you sure that BleachBit_console.bat doesn't have a "pause" command at the end?
My YouTube channel | Release date of my 13th playlist: August 24, 2020

bzl333
Posts: 167
Joined: Wed Jan 12, 2011 3:11 pm

Re: Program that runs other programs, then shuts down?

#6 Post by bzl333 » Tue Feb 26, 2013 8:00 am

SYSTEM wrote: CALL is supposed to return control to the parent script when the child script has been run, so your example should have worked. Are you sure that BleachBit_console.bat doesn't have a "pause" command at the end?
wow, there was a pause command there :oops:
seems to work fine now.

thanks :)

User avatar
guinness
Posts: 4118
Joined: Mon Aug 27, 2007 2:00 am
Contact:

Re: Program that runs other programs, then shuts down?

#7 Post by guinness » Tue Feb 26, 2013 8:31 am

I wonder when batch scripting will become obsolete?
Added 179 Applications: Portable

User avatar
Midas
Posts: 5815
Joined: Mon Dec 07, 2009 7:09 am
Location: Sol3

Re: Program that runs other programs, then shuts down?

#8 Post by Midas » Tue Feb 26, 2013 9:03 am

guinness wrote:I wonder when batch scripting will become obsolete?
When BASh gets a native port for Windows... ? :twisted:

User avatar
SYSTEM
Posts: 1969
Joined: Sat Jul 31, 2010 1:19 am
Location: Helsinki, Finland

Re: Program that runs other programs, then shuts down?

#9 Post by SYSTEM » Tue Feb 26, 2013 9:49 am

guinness wrote:I wonder when batch scripting will become obsolete?
Never?

Batch has the advantage that it works out of the box. You don't need to download a third-party interpreter in order to run batch files.
My YouTube channel | Release date of my 13th playlist: August 24, 2020

User avatar
guinness
Posts: 4118
Joined: Mon Aug 27, 2007 2:00 am
Contact:

Re: Program that runs other programs, then shuts down?

#10 Post by guinness » Tue Feb 26, 2013 1:41 pm

Just read the wiki page for batch, didn't know KiXtart was developed by a Microsoft employee.
Added 179 Applications: Portable

spchtr
Posts: 24
Joined: Sat Aug 26, 2006 12:32 am

Re: Program that runs other programs, then shuts down?

#11 Post by spchtr » Thu Feb 28, 2013 5:01 pm

Like this?

http://win-bash.sourceforge.net/
Midas wrote:
guinness wrote:I wonder when batch scripting will become obsolete?
When BASh gets a native port for Windows... ? :twisted:

Post Reply