in reply to open programs with a particular file!

That depends on the program you are trying to call. Look up the programs documentation if and how you can specify a command line parameter to make it open a file after startup. In the case of textpad it's simple. Simply pass it the name of the file.
system ("textpad.exe", "myfile.txt");


holli, /regexed monk/