Jump to content
Ketarin forum

Write to *.ini


josh
 Share

Recommended Posts

Hi all,

 

I decided to share a simple, no frills way of writing to *.ini. I needed this feature for some of my unattended installs, and i discovered Windows doesn't provide an easy way to do it. On the contrary. All you have to do is to download NirCmd, and use inisetval command. I suggest you copy nircmd.exe to the same folder as Ketarin. Syntax:

 

inisetval [iNI filename] [section] [key] [value] 
Writes a value into INI file. If the file doesn't exist, it'll automatically be created. 
Example: 
inisetval "c:\windows\test.ini" "section1" "TestValue" "1" 

 

Using inisetval with Ketarin:

nircmd inisetval "{root}USB-Toolkit\{category}\{appname}\INSTALL.INF" "auto" "auto" "1" & nircmd inisetval "{root}USB-Toolkit\{category}\{appname}\INSTALL.INF" "auto" "alllang" "0"

 

Another example:

start "" /wait {root}USB-Toolkit\Backup\Uniextract\UniExtract.exe "{file}" "{root}USB-Toolkit\{category}\{appname}" &
start "" /wait nircmd inisetval "{root}USB-Toolkit\{category}\{appname}\ImgBurn.ini" "Settings" "PortableMode" "1" & 
start "" /wait nircmd inisetval "{root}USB-Toolkit\{category}\{appname}\ImgBurn.ini" "Settings" "FILELOCATIONS_GraphDataFiles" ".\Graph Data Files\" & 
start "" /wait nircmd inisetval "{root}USB-Toolkit\{category}\{appname}\ImgBurn.ini" "Settings" "FILELOCATIONS_ImageFiles" ".\Image Files\" &
start "" /wait nircmd inisetval "{root}USB-Toolkit\{category}\{appname}\ImgBurn.ini" "Settings" "FILELOCATIONS_LogFiles" ".\Log Files\" &
start "" /wait nircmd inisetval "{root}USB-Toolkit\{category}\{appname}\ImgBurn.ini" "Settings" "FILELOCATIONS_ProjectFiles" ".\Project Files\" &
start "" /wait nircmd inisetval "{root}USB-Toolkit\{category}\{appname}\ImgBurn.ini" "Settings" "FILELOCATIONS_QueueFiles" ".\Queue Files\" &
rd "{root}USB-Toolkit\{category}\{appname}\$temp" /s /q & 
rd "{root}USB-Toolkit\{category}\{appname}\$PLUGINSDIR" /s /q & 
rd "{root}USB-Toolkit\{category}\{appname}\Uniblue" /s /q

 

NirCmd:

 

Website - http://www.nirsoft.net/utils/nircmd.html

 

Download - http://www.nirsoft.net/utils/nircmd.zip

Edited by josh
Link to comment
Share on other sites

  • 2 weeks later...

Hi josh,

 

!!!!GREAT!!!!

 

I was not searching for that, but now I found it ;-)

I think I will use it for my templates and my next project:

 

- loading the apps, descriptions and screenshots with ketarin

- generating an INI

- parsing the INI with Java script

- putting all to gether on a local website

 

...... and I have my own web based software database, without using apache or sql.

 

That could be nice....

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.