Jump to content

create directory and to copy files


Silvinho
 Share

Recommended Posts

How to create the following directory structure automatically?

c:\Artefato Inspecionado\PCC

\IPU

\ECP

and in these directories I want to copy three files .xls that are in other directory in the

following way: c:\templates pcc.xls

ipu.xls

ecp.xls

Link to comment
Share on other sites

Please look at the AutoIt help file under "FileCopy" where it says this about the flag:

8 = Create destination directory structure if it doesn't exist (See Remarks).

Then, remember to not start two instances of the same topic, one right after the next.

Das Häschen benutzt Radar

Link to comment
Share on other sites

Here is my dumd and straight way.

If Not FileExists("c:\Artefato Inspecionado\PCC") Then

If DirCreate("c:\Artefato Inspecionado\PCC") == 0 Then

_MsgBox ("OK", "Warning", "Error encountered creating the log directory")

Else

FileCopy("c:\templates pcc.xls","c:\Artefato Inspecionado\PCC\templates pcc.xls")

EndIf

EndIf

If Not FileExists("c:\Artefato Inspecionado\IPU") Then

If DirCreate("c:\Artefato Inspecionado\IPU") == 0 Then

_MsgBox ("OK", "Warning", "Error encountered creating the log directory")

Else

FileCopy("c:\templates pcc.xls","c:\Artefato Inspecionado\PCC\templates pcc.xls")

EndIf

EndIf

If Not FileExists("c:\Artefato Inspecionado\ECP") Then

If DirCreate("c:\Artefato Inspecionado\ECP") == 0 Then

_MsgBox ("OK", "Warning", "Error encountered creating the log directory")

EndIf

EndIf

Something like this, creating the directory and copying the files.

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...