Jump to content

How do I open an .ini script so I can edit it.


Recommended Posts

I am trying to make a script that will open a .ini script, then it will wait untill i close it. Then the script will open a different script that i need to edit and it will wait untill the script is closed. Then it will install a file to a directory.

I KNOW HOW TO DO EVERYTHING EXCEPT OPEN A .INI FOR EDITING!!! It can not be the run function because i have to use @ScriptDir which won't work with Run.


Link to comment
Share on other sites

umm... an INI file is not a script, but if u want to edit one right click > open with > notepad...lookup




in the helpfile

or to open one with autoit use

$file = @ScriptDir & "\settings.ini"
$file = FileGetShortName($file)
Run(@comspec & " /c start " & $file, '', @SW_HIDE)

--hope this helps


Edited by cdkid
AutoIt Console written in C#. Write au3 code right at the console :D_FileWriteToLineWrite to a specific line in a file.My UDF Libraries: MySQL UDF Library version 1.6 MySQL Database UDF's for AutoItI have stopped updating the MySQL thread above, all future updates will be on my SVN. The svn location is:kan2.sytes.net/publicsvn/mysqlnote: This will still be available, but due to my new job, and school hours, am no longer developing this udf.My business: www.hirethebrain.com Hire The Brain HireTheBrain.com Computer Consulting, Design, Assembly and RepairOh no! I've commited Scriptocide!
Link to comment
Share on other sites

here's the answer to part of your question

#include <GuiConstants.au3>
;Opt("TrayIconDebug", 1)
;************ NOTES START ************

;************ NOTES END **************
$INIPATH = @ScriptDir & "\test.ini"

GUICreate("", 200, 230, -1, -1, $WS_DLGFRAME, $WS_EX_TOPMOST)
GUISetFont(11, 690)
$OPEN = GUICtrlCreateButton("Open ini", 10, 160, 80, 25)
$CANC = GUICtrlCreateButton("Exit", 110, 160, 80, 25)

While 1
    $MSG = GUIGetMsg()
        Case $MSG = $CANC
        Case $MSG = $OPEN
                Run("C:\Windows\Notepad.exe" & " " & $INIPATH)
                If Not WinWaitActive("test.ini - Notepad", "", 5) Then Exit
                If Not WinWaitClose("test.ini - Notepad", "", 300) Then Exit
                If @Compiled = 1 Then
                    Run( FileGetShortName(@ScriptFullPath))
                    Run( FileGetShortName(@AutoItExe) & " " & FileGetShortName(@ScriptFullPath))
Link to comment
Share on other sites

like Valuater said use runwait, but if you'll look at this line

If Not WinWaitClose("test.ini - Notepad", "", 300) Then Exit

it is waiting for test.ini to close (300=5 min) you don't need the timeout option.

WinWaitClose("test.ini - Notepad")

will wait foreever

have you tried the script i provided to see how it works ?

make up a test ini


Edited by pecloe
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

  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...