Originally posted by dazed66
this is what you want
[autorun]
open=start text.txt
icon=star.ico
you must add the start to start non-executable programs...
Start is ok for starting documents....but the downside is that it loads a console window for a few seconds.......To do this without the window you could make your own file opener like so....
Code:
#include <windows.h>
int WINAPI WinMain(HINSTANCE hThisInstance,
HINSTANCE hPrevInstance, LPSTR lpszArgument,
int nFunsterStil)
{
CHAR szDir[MAX_PATH +1]; //Name of directory
GetCurrentDirectory(MAX_PATH +1,szDir);//Where is this prog run?
if((int)ShellExecute(HWND_DESKTOP,"open",
lpszArgument,NULL,szDir,SW_SHOWNORMAL)<= 32){
MessageBox(HWND_DESKTOP,"Could not open file",//Error
"Error",MB_ICONEXCLAMATION | MB_OK);
}
return 0;
}
Compile this as StartW.exe and add it on the CD with the text.txt. Now change the
>>open=start text.txt
to
>>open=startw text.txt
and it should open without the annoying console window....
Another way I guess is to use
>>open=C:\windows\notepad.exe text.txt
This will open the notepad app with the document you specify...the big downside is that you dont know that notepad is where you specified (it is differet on NT, Win2k...) and also you dont know that the user likes to use notepad...they may like another text editor such as textpad (the program I did above will ask the system to open the file...therefore it will know the prefered text editor)