Sign in to follow this  
Followers 0
Mack

IniRead ( Again )

9 posts in this topic

I finally did it, created my own ini read script,

But then the power turned off and nothing was saved as i changed some things in the script.

$par = IniReadSection("settings.ini", "section1")
If @error Then 
    MsgBox(4096, "", "Error occured, probably no INI file.")
Else
    For $i = 1 To $par[0][0]
              MsgBox(4096, "", "Key: " & $par[$i][0] & @CRLF & "Value: " & $par[$i][1])
run("explorer.exe" " & ," "$par[$i][1]") 
    Next
EndIf

I want explorer to run the directory set in the ini section1, so can someone fix this script?

Share this post


Link to post
Share on other sites



you should have found your "error" with the "syntax check" in sciTE.

also, i replaced "run" with "runwait" ... this will wait for you to close the existing explorer before opening a new one

$par = IniReadSection("settings.ini", "section1")
If @error Then 
    MsgBox(4096, "", "Error occured, probably no INI file.")
Else
    For $i = 1 To $par[0][0]
        MsgBox(4096, "", "Key: " & $par[$i][0] & @CRLF & "Value: " & $par[$i][1])
        RunWait("explorer.exe " & "$par[$i][1]") 
    Next
EndIf

*********** not tested ***********

hope that helps

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites

Also...

note that the first charactor of $par[$i][1] needs to be a "\" or...

you may need a "\" added to your run script (not sure ).. like this

Run("explorer.exe " & @HomeDrive & "\", "", @SW_MAXIMIZE)

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites

Gonna test it when i come home.

Share this post


Link to post
Share on other sites

Script doesn't work.

Share this post


Link to post
Share on other sites

It does now

Share this post


Link to post
Share on other sites

Give me one example of $par[$i][1]

$par[$i][1] = ????????

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites

Well it does work now:

Run("explorer.exe " & $par[$i][1] & "\", "", @SW_MAXIMIZE)

$par[$i][1] = C:\Test\Test

Share this post


Link to post
Share on other sites

Good

8)

I knew it should, glad i could help 8)


NEWHeader1.png

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  
Followers 0