Jump to content
Sign in to follow this  
gcue

multiple source and destination copies

Recommended Posts

gcue

i have an INI that has the following structure:

[sOURCES]

source1=\\erepath\dir\top\gm\backup\d31z\d1z.zip

source2=\\sdfpath\dirdd\topd\gdm\backup\d3441z\d31z.zip

[TARGETS]

target1=\\d0079214\c$

target2=\\d0034411\c$

i am trying to use IniReadSection to read both the SOURCE and TARGET Sections at the same time and do (unzip SOURCE1 to TARGET1, unzip SOURCE2 to TARGET2.......) Im stuck bc i dont know how to do these array references simultaneously ($SOURCE[$s][0] / $TARGET[$t][0])

$SOURCES = IniReadSection($INI, "SOURCES")

If @error Then
    MsgBox(4096, "", "Error occurred, probably no INI file.")
Else
    
    For $s = 1 To $SOURCES[0][0]
        ;MsgBox(4096, "", $SOURCES[$s][0])
    Next
EndIf


$TARGETS = IniReadSection($INI, "TARGETS")
If @error Then
    MsgBox(4096, "", "Error occurred, probably no INI file.")
Else
    For $t = 1 To $TARGETS[0][0]
        ;MsgBox(4096, "", $SOURCES[$s][0])
    Next
EndIf

RunWait("unzip.exe -o " & $SOURCE[$s][0] & " -d " & $TARGET[$t][0])

Share this post


Link to post
Share on other sites
youknowwho4eva

$SOURCES = IniReadSection($INI, "SOURCES")
$target = IniReadSection($INI, "target")


If @error Then
    MsgBox(4096, "", "Error occurred, probably no INI file.")
Else
    
    For $s = 1 To $SOURCES[0][0]
        ;MsgBox(4096, "", $SOURCES[$s][0])
        ;MsgBox(4096, "", $target[$s][0])
RunWait("unzip.exe -o " & $SOURCE[$s][0] & " -d " & $TARGET[$s][0])

    Next
endif

You mean like such?

Edit: had to put target ini back in there

Edited by youknowwho4eva

Giggity

Share this post


Link to post
Share on other sites
gcue

ok i get it...

thanks man

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  

×