Shortcut making .ini behaving abnormally
-
Greetings... My application createas .ini file to store some data. I have installer which creates a shortcuts to the .exe the Program Files directory and creates two icons in the start menu and in the desktop. When I run the application through the desktop shortcut, the .ini file is getting created in the Program Files directory which is what I expect. But when I run the application from the Start menu shortcut, the .ini is getting created in the Start Menu diorectory which is causing the .ini file to be also shown in the Start Menu, which I dont want. In my application I am using the following method which I belive is wrong - CreateFile ( "Application.ini", ........ ); How can I make sure that the ini is created in the directory of the program and not anywhere ? Thanks in advance. Rgds Ritesh
-
Greetings... My application createas .ini file to store some data. I have installer which creates a shortcuts to the .exe the Program Files directory and creates two icons in the start menu and in the desktop. When I run the application through the desktop shortcut, the .ini file is getting created in the Program Files directory which is what I expect. But when I run the application from the Start menu shortcut, the .ini is getting created in the Start Menu diorectory which is causing the .ini file to be also shown in the Start Menu, which I dont want. In my application I am using the following method which I belive is wrong - CreateFile ( "Application.ini", ........ ); How can I make sure that the ini is created in the directory of the program and not anywhere ? Thanks in advance. Rgds Ritesh
Try with
".\\Application.ini"
. Joaquín M López Muñoz Telefónica, Investigación y Desarrollo -
Greetings... My application createas .ini file to store some data. I have installer which creates a shortcuts to the .exe the Program Files directory and creates two icons in the start menu and in the desktop. When I run the application through the desktop shortcut, the .ini file is getting created in the Program Files directory which is what I expect. But when I run the application from the Start menu shortcut, the .ini is getting created in the Start Menu diorectory which is causing the .ini file to be also shown in the Start Menu, which I dont want. In my application I am using the following method which I belive is wrong - CreateFile ( "Application.ini", ........ ); How can I make sure that the ini is created in the directory of the program and not anywhere ? Thanks in advance. Rgds Ritesh
It sounds like your two shortcuts are using different 'Start it' folders. (Look at the properties of the shortcuts) You can either make sure that both shortcuts use the same folder, or you can use an absolute path in your program to access the ini file.
as long as I live it will be fine / there's nothing what I can do /
the world will die and so do I / so why should I take care
'Take Care' Funker Vogt -
It sounds like your two shortcuts are using different 'Start it' folders. (Look at the properties of the shortcuts) You can either make sure that both shortcuts use the same folder, or you can use an absolute path in your program to access the ini file.
as long as I live it will be fine / there's nothing what I can do /
the world will die and so do I / so why should I take care
'Take Care' Funker VogtThanks. What is the best method to know the directory in which .EXE is being executed ? Ritesh