MSFN Forum: How to AutoIT copy a file to non-absolute directory? - MSFN Forum

Jump to content



Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

How to AutoIT copy a file to non-absolute directory? Rate Topic: -----

#1 User is offline   Decker87 

  • Newbie
  • Group: Members
  • Posts: 30
  • Joined: 20-August 07

Posted 22 August 2007 - 02:00 AM

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)

This post has been edited by Decker87: 22 August 2007 - 02:13 AM



#2 User is offline   bj-kaiser 

  • Advanced Member
  • PipPipPip
  • Group: Members
  • Posts: 415
  • Joined: 05-December 06
  • OS:Windows 7 x86
  • Country: Country Flag

Posted 22 August 2007 - 03:22 AM

RTFM:
(AutoIt's Helpfile)
Macro Reference
...
@AppDataDir - path to current user's Application Data
...
@ProgramFilesDir - path to Program Files folder

#3 User is offline   Decker87 

  • Newbie
  • Group: Members
  • Posts: 30
  • Joined: 20-August 07

Posted 22 August 2007 - 11:23 AM

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!

This post has been edited by Decker87: 22 August 2007 - 11:42 AM


#4 User is offline   nmX.Memnoch 

  • MSFN Master
  • Group: Moderator
  • Posts: 2,086
  • Joined: 15-September 04
  • OS:Windows 7 x64
  • Country: Country Flag

Posted 22 August 2007 - 11:58 AM

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\")

This post has been edited by nmX.Memnoch: 22 August 2007 - 11:58 AM


Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users



All trademarks mentioned on this page are the property of their respective owners
Copyright © 2001 - 2011 msfn.org
Privacy Policy