system("test.txt");//opens the text file in the current directory
system("notepad.exe");
CA50 said:Most of you have ever encountered with a MS-DOS batch file, where we can trigger an *.exe or any other file just by entering the file name. I want to know if this is also possible using C.:huh:
I hope i am clear to you. please reply
Not possible in C.
IMNSHO, whoever says yes need to relearn C.
Thats what i want to do. but your method is not working."start blah.txt"For txt files and everything else you'll probably need to system("start blah.txt") . This _should_ spawn notepad or whatever you have associated with txt files.
blufox said:Not possible in C.
IMNSHO, whoever says yes need to relearn C.
Cu,
CA50 said:Thats what i want to do. but your method is not working."start blah.txt"
if .txt
execute "notepad.exe filename.txt"
else if .jpg OR .gif OR .bmp
execute "mspaint.exe filename.jpg"