# Automatically Play a CD with Zinf in Windows

Read some information on how to add auotplay on in zinf for windows. Zinf is a free Open Source music player for all sorts of platforms. Becuase My girlfriend uses a quite old computer windows media player gobbles up all the resources. But also because Windows media player is ugly, and has one of the worst UI's ever. (and then I don't even start about the fact tha Windows media player is the excuse for microsoft to enforce its own media standards)

So all in all there are millions of reasons for choosing a light and small application that does some great media managing.
One thing it does not do properly, however, is play a CD on insert in Windows. This feature is called Autoplay.

To use autoplay you must assign zinf with audio CDS. But then you will find another problem: Zinf will not play the CD properly. I have no idea why, neither do I know if this feature is not implemented at all or if its broken.
I do know that zinf will play adudio files with the command

c:\path\to\zinf\zinf.exe file1 file2 etc

So all we need to do, is feed zinf the files on the cd as filenames in nice list.
I made a small batch file for that and called it zinfAudioCD.batthe file looks like this:
@ECHO OFFSET STRING=FOR %%X IN (%1*.cda) DO SET STRING=!STRING! %%Xc:\progra~1\zinf\zinf.exe %STRING%

As you can see I prepare a small list with all cda files on a cd and present them to the zinf program.
One problem that occurs here is that not all windows systems (can these guys at Micro\$oft actually do anything properly?) support the so called "delayed environment variable". Look on this dos resourse website for more information.

So let's assume you have the batch file working.

You now need to assign this batch file with the AutoPlay function in windows. I have only (an English) windows XP at hand, so the example might only work for XP.

1) Open "my Computer"
2) Open menu "Tools" then "Folder Options"
3) Select tab "File Types"
4) selection "audio CD"
5) Press button "[ advanced ]"
6) Press button "[ New ]"
7) Type at Action: Play in Zinf
8) Type at Appl...: the name and location of the batch and "%L"
I have: C:\Progra~1\Zinf\zinfAudioCD.bat "%L"
9) press OK.
10) Choose "[ set Default ]" for "play in Zinf"
11) Press apply and close
And try inserting a music cd.

Please report me any questions, and or ideas below!

Dit artikel verscheen op bler.webschuur.com. En is overgezet naar dit blog

in programming53

Over de auteur: Bèr Kessels is een ervaren webdeveloper met een grote passie voor techniek en Open Source. Een gouden combinatie om de techniek goed en efficiënt toe te passen. Volg @berkes op Twitter. Of lees meer over Bèr.