Jump to content
Sign in to follow this  
tannerli

Copy into each folder

Recommended Posts

tannerli

Hi guys!

I've got two files and i have to put them into every folder in a directory:

For example i have a folder test in my workingdir and i have to copy the files into test/subfolder/file.ini

then i go on and copy it into test2/subfolder/file.txt

Is it possible to do something like that...

CODE
For each folder in @workingdir

Filecopy(file1, subdirectory)

Next

...or that...

CODE

Filecopy(file, @workingdir & */subfolder)

or something similar?

Thank you very much (If you could get me an answer i could impress my boss :shocked: )

Share this post


Link to post
Share on other sites
t0ddie

take a look at the _FileListToArray function.

use the flag 2 for folders only


Valik Note Added 19 October 2006 - 08:38 AMAdded to warn level I just plain don't like you.

Share this post


Link to post
Share on other sites
t0ddie

here, i did it for you.

#Include <File.au3>
$FolderList=_FileListToArray(@DesktopDir, "*", 2)

If @Error=1 Then
    MsgBox (0,"","No Folders Found.")
    Exit
EndIf
$count = $FolderList[0]
for $x = 1 to $count
    FileCopy(@DesktopDir & "/test.txt",$FolderList[$x] & "/test.txt",1)
    Next
MsgBox(0,"test","all done!")
Edited by t0ddie

Valik Note Added 19 October 2006 - 08:38 AMAdded to warn level I just plain don't like you.

Share this post


Link to post
Share on other sites
tannerli

Hey that was fast! Thank you! :shocked:

This makes the thin much easier^^

greetz tannerli

P.S I did see your post about the 64 hotkeys and i think that there's no way to get more...

But i also thougt i couldn't acces evry folder so i could be wrong :(

Share this post


Link to post
Share on other sites
t0ddie

Hey that was fast! Thank you! :shocked:

This makes the thin much easier^^

greetz tannerli

P.S I did see your post about the 64 hotkeys and i think that there's no way to get more...

But i also thougt i couldn't acces evry folder so i could be wrong :(

theres an easy way to get more hotkeys, you just use 2 scripts.

i was hoping for a better alternative.

im not usually online to help answer questions..., but i will agree with you.

that was a fast reply.

thanks! and your welcome.


Valik Note Added 19 October 2006 - 08:38 AMAdded to warn level I just plain don't like you.

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  

×