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 »

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 »

Search for Shutdown.

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

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

#3 Post by SYSTEM »

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 »

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: 2043
Joined: Sat Jul 31, 2010 1:19 am
Location: Helsinki, Finland

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

#5 Post by SYSTEM »

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 »

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 »

I wonder when batch scripting will become obsolete?

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

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

#8 Post by Midas »

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

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

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

#9 Post by SYSTEM »

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 »

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

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

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

#11 Post by spchtr »

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