The file1.dat is passed as a parameter using the dwFillAttribute of the pgm2.
just for understanding, what do you actually pass in dwFillAttribute ? (I assume it's the number '1' in your example, and then pgm2 recreates the name with a template like file%lu.dat)
another point, if you do what Andi suggested, then please also code what dwFillAttribute is meant for: - setting the default color attribute for a console program (dwFillAttribute is not meant for passing values between programs)
A+ --------------- Eric Pouech (http://perso.wanadoo.fr/eric.pouech/) The future will be better tomorrow, Vice President Dan Quayle
____________________________________________________________ Faites un voeu et puis Voila ! www.voila.fr Avec Voila Mail, consultez vos e-mails sur votre mobile Wap.