You are here

Newb: Coping an *.ini back and fourth

2 posts / 0 new
Last post
Micronta
Offline
Last seen: 10 years 3 weeks ago
Joined: 2014-03-27 11:15
Newb: Coping an *.ini back and fourth

Hello all,

I have a database app that I would like to make portable. When it starts, it wants to read its configuration from an *.INI. The location for the *.INI is hard-coded in the single executable, it's always C:\Books-db\bdb.ini. The mapping for the actual database file is in that *.ini. The *.ini gets heavily modified in every session.

What I want to achieve is that I can keep both the *.exe and the database file on the stick. When it launches, I would like to copy the *.ini to C:\, to the folder it wants and after the program is done, I would like to copy the *.ini back.

I have tried the following in my launcher.ini:

[FilesMove]
bdb.ini=C:\Books-db\bdb.ini

It copies the *.ini down but it doesn't retrive it after the app finishes. What am I doing wrong (or can't it be even done)? Thanks for any suggestions.

And am a newb, please go easy on me if it's a silly question. Smile

Thanks,

Matt

darksabre76
darksabre76's picture
Offline
Last seen: 1 week 1 day ago
Developer
Joined: 2011-04-19 23:28
Syntax

Odds are that it's not actually copying bdb.ini to that folder and the program is actually just creating it. The proper syntax to move a file is as follows:

[FilesMove]
bdb.ini=C:\Books-db\

Notice the file isn't mentioned on the righthand side of the setting. It is also worth mentioning that if it's writing directly to the root of C, it might need to be run as an administrator, but I'm not completely sure.

Log in or register to post comments