Quantcast
Channel: AutoIt v3 - General Help and Support
Viewing all articles
Browse latest Browse all 12506

Exit loop

$
0
0

Hi guys

 

I got help creating this little script that moves all content (folders and files) from A to B

It works perfect, but I just realized that it never exits the loop.

So anything below the "WEnd" is not being processed.

Does anyone have a suggestion?

 

Thanks

$source = 'C:\folderA' $dest = 'C:\folderB' FileMove($source & "\*.*", $dest, 1) ;Move all source files first $hSearch = FileFindFirstFile($Source & "\*.*") ;Now find any remaining (in this case: folders) if $hSearch = -1 then exit ;No folders While 1 $hFilename = FileFindNextFile($hSearch) if @ERROR then exitloop ;No more files DirMove($source & "\" & $hFilename, $Dest,1);move subdir and all contents to new location WEnd

Viewing all articles
Browse latest Browse all 12506

Trending Articles