Author Topic: Command line for shutdown method  (Read 2594 times)

Offline chory

  • Contributor
  • ***
  • Posts: 15
Command line for shutdown method
« on: May 03, 2009, 01:22:42 am »
When finish a application, launch alt.binz and when downloads finish shutdown computer

Offline davidq666

  • Contributor
  • ***
  • Posts: 1302
  • Watashi Wa Ero Desu!
Re: Command line for shutdown method
« Reply #1 on: May 03, 2009, 09:42:29 am »
When finish a application, launch alt.binz and when downloads finish shutdown computer

what exactly do u mean?

Offline DM8Mydog

  • Contributor
  • ***
  • Posts: 48
Re: Command line for shutdown method
« Reply #2 on: May 03, 2009, 08:54:02 pm »
I think he means something in the lines of, ...if a some process he's running now finishes (ie some video editing app, or some burning app) launch alt.binz, start d/ling, and when d/ls finish, shutdown computer...

well the first part is kinda beyond the scope of alt.binz, the second one is already an option , altbinz does have a 'shutdown when done' button

Offline Hecks

  • Contributor
  • ***
  • Posts: 2011
  • naughty cop
Re: Command line for shutdown method
« Reply #3 on: May 03, 2009, 09:30:18 pm »
Well, it's easy enough to chain running of apps if you're OK with batch files.  The simple way:

Code: [Select]
@ECHO OFF
echo Starting Proggy1...
cd "C:\Program Files\Proggy1\"
start /wait proggy1.exe
echo Starting Proggy2 ...
cd "C:\Program Files\Proggy2\"
start proggy2.exe
echo Finished!
exit

To check whether an app is running, use:

tasklist | find "proggy1.exe" > nul
if %ERRORLEVEL%==1 do something

Here's a bit of code from an old script that used altbinz_status.xml to see whether Alt.Binz was downloading:

Code: [Select]
:check_download_status
Echo %DATE% %TIME:~0,-3% Checking AB download status .......

:check_loop
FOR /f "EOL=- TOKENS=3 DELIMS=<>" %%S IN ('find "<CurrentSpeed>" "C:\Program files\Altbinz\altbinz_status.xml"') DO (echo %date% %TIME:~0,-3% Current Speed: %%S)
find "<ETA>Unknown</ETA>" "C:\Program files\Altbinz\altbinz_status.xml" >nul
if %ERRORLEVEL%==0 goto :disconnect_altbinz
call c:\wait.bat 60
goto :check_loop

... bla blah ...

:shutdown
Echo %DATE% %TIME:~0,-3% Hibernating .......................
%SYSTEMROOT%\System32\rundll32.exe powrprof.dll,SetSuspendState 1,1,0


A lot easier to do with Powershell!