Jump to content

Recommended Posts

Posted (edited)

Hi. I'm trying to use autoIT to copy a file from the local directory to the current user's Application Data folder.

However, I don't know how to specify what this folder is!

Also, I am having trouble with drive letters. How can I specify system folders, such as Program Files if I don't know for sure the drive letter?

I also would like to know how to specify a directory in which you do not know the name, but know some other things. For example, a directory which you do not know its name, but know it is the only directory within its parent (and therefore the largest and the smallest, etc)

Edited by Decker87

Posted

RTFM:

(AutoIt's Helpfile)

Macro Reference

...

@AppDataDir - path to current user's Application Data

...

@ProgramFilesDir - path to Program Files folder

Posted (edited)

Gah! I'm so sorry I missed that! I must have been brain-dead at the time.

But, I'm very confused now. What syntax do use with the macros?

I am trying to use FileCopy to copy a file to the Common Files directory.

FileCopy("file.dll", @CommonFilesDir+"\SPX\", 8)

But it's just creating a new folder in the folder the script is run from! I searched all through the manual, and could not find a single example!

Edited by Decker87
Posted (edited)

You have to use '&' instead of '+':

FileCopy(@ScriptDir & "\file.dll",@CommonFilesDir & "\SPX\",8)

If that still doesn't work you can try this:

DirCreate(@CommonFilesDir & "\SPX\")
FileCopy(@ScriptDir & "\file.dll",@CommonFilesDir & "\SPX\")

Edited by nmX.Memnoch

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
  • Recently Browsing   0 members

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