Jump to content
Sign in to follow this  
Brentp

Prompt to change text in a file

Recommended Posts

Brentp

Does any one have a script that will prompt the user to enter some text, and then it will edit a ini file on c: and replace some holding text with the text the user entered.

Thanks all

Brent

Share this post


Link to post
Share on other sites
jfcby

Brentp,

Check this link and see if will help you.

jfcby


Determined -- Devoted -- Delivered Make your mind up -- to seriously apply yourself -- accomplishing the desired results. **** A soft answer turneth away wrath: but grievous words stir up anger. Proverbs 15:1 KJB ****

Share this post


Link to post
Share on other sites
Woddles

Does any one have a script that will prompt the user to enter some text, and then it will edit a ini file on c: and replace some holding text with the text the user entered.

Thanks all

Brent

Im guessing you want something like this:

If FileExists("config.ini") = 1 Then ;if the file 'config.ini' exists
    $Input = InputBox("input","enter your data")
    IniWriteSection ("config.ini", "Configuration", "config1="&$Input)
Else;if the file 'config.ini' DOESN'T exist
    $Input = InputBox("input","enter your data")
    IniWriteSection ("config.ini", "Configuration", "config1="&$Input)
    EndIf

Also, to do multiple lines for the .ini (if you don't know how to already)

IniWriteSection ("config.ini", "Configuration","config1="&$Input & @LF & "config2="&$Input2)

If this isn't what you wanted, woops! XD

Share this post


Link to post
Share on other sites
Brentp

Thanks Woddles

This helped, I was able to do what I wanted.

And I glad you added the part for multiple lines as I needed that too.

Thanks

Share this post


Link to post
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
Sign in to follow this  

×