Sign in to follow this  
Followers 0
robeert

Copy Files\Dir

2 posts in this topic

Hy! can anyone help me with this problem?

I want to copy one file in one or more dir, but the problem is that i know only a part of the name of the dir.

xxx.txt -> \direct*\

And... i'm a beginner in autoit

Share this post


Link to post
Share on other sites



robeert

#include <File.au3>
Dim $dir = "direct", $ipath = "c:\test", $ifile = "c:\test.txt"
$FileList = _FileListToArray($ipath, "*", 2)
For $i = 1 To $FileList[0]
    If StringInStr($FileList[$i], $dir) Then FileCopy($ifile, $ipath & "\" & $FileList[$i])
    Next

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