PDA

View Full Version : Script .bat for scheduled power on /off



vayaruina
2005-10-21, 15:17
Hi ,
Does anybody knows how to make an script to run it on Windows XP with the Task Manager ( a batch file *.bat ) in order to power on the SQ2 and play a Playlist . Ill need also another script to power it off.

The alarm feature starts it , but every day at the same time ( even on saturday and sunday ) , and it can not stop it with out pushing any button.

Thanks.

autopilot
2005-10-21, 15:36
i saw a program once on www.downloads.com that could run and end programs at set times. Can't remember what it was called though sorry.

Also, could you not use windows task scheduler?

EDIT: Oh, i see you need to run a specific playlist too.

jensboe
2005-10-22, 00:35
vayaruina,

in SlimServer 6.2 (still beta) you can define different start times with different playlists for every day.
check the alarm menu for your squeezebox2 in slimserver 6.2.

cheers
jens

vayaruina
2005-10-22, 01:44
jensboe ,

so , we cant do a simply batch file with the command lines options ?

Maybe 6.2 can power up the system , but id like to power it off too ( i dont like too much to play with buttons on early working mornings )

Thank you mate

mherger
2005-10-22, 09:51
> so , we can´t do a simply batch file with the command lines options ?

Of course you can. Have a look at the CLI documentation. But on Windows
you'd need some additional tools to do connections from a batch file. Or
some Perl scripting knowledge ;-).

Or have a search in the forums: there was recently a "benchmarking"
program published, which can run a batch of CLI commands from a text file.
You could use it to automate tasks on from batch files (the file was
called sstime.exe)

--

Michael

-----------------------------------------------------------
Help translate SlimServer by using the
StringEditor Plugin (http://www.herger.net/slim/)

vayaruina
2005-10-23, 01:49
Ive downloaded the .exe from : http://media.qwertyboy.org/files/sstime.exe form the threat :

http://forums.slimdevices.com/showthread.php?t=17032&highlight=sstime.exe

im gonna try and post the script ( if i can to make it works , because i havent programing knowledge but so many illusion )

Thank you folks

max.spicer
2005-10-23, 03:12
There's some code in my shutdown plugin at http://www.thespicers.net/slim.html#misc that fires commands against the cli. I stole this code from someone else, but can't remember who now (it's acknowledged in the source, though). You could easily change this to do something different and then call it from a batch file.

Max


Ive downloaded the .exe from : http://media.qwertyboy.org/files/sstime.exe form the threat :

http://forums.slimdevices.com/showthread.php?t=17032&highlight=sstime.exe

im gonna try and post the script ( if i can to make it works , because i havent programing knowledge but so many illusion )

Thank you folks

vayaruina
2005-10-30, 11:18
To set an scheduled Power on/off of the Squeeze Box i have done this ( for windows XP ):

STEP 1. WAKE UP

1.- Install the Plugin called Alarm A [ http://callisto.deane-freeman.com/slimserver/ ] . With this you can wake up every weekday or weekend.

2.- Install de Slim Server 6.2 and set up the alarm ( you can set it up for every day or for a single day ) , thats 8 alarms in one ( great service ).

STEP 2. POWER OFF

3.- Download http://media.qwertyboy.org/files/sstime.exe to send CLI to the server

4.- Make a simple text file called ( for example ) poweroff.txt with this lines :

00:04:20:10:aa:aa power 0

The first number is the MAC address of the player

5.- Make a .bat file called ( for example ) ShutSQ2.bat with this lines :


sstime.exe 192.168.20.1 9090 poweroff.txt


where 192.168.20.1 is the IP of the Slim Server ( not of the player ) , 9090 is the standar communication port , and poweroff.txt is the name for the file youve done on step 4.

STEP 3. SCHEDULE

6 By using the Windows Task Manager Schedule the ShutSQ2.bat file to power off the SQ2 at the desired time after the alarm has waked it up .

Hope this will be useful for you

Thank you to all the folks that help me before.

;)