Sign in to follow this  
Followers 0
ftpkalyan

Copy itself to a location

8 posts in this topic

Please can someone tell me how to copy an application to another location which is coded in autoit. i need this because i am able to run the application from kixstart but not able to copy itself toa spicific folder. This application all does is to install antivirus product into the computers in a domain.

Share this post


Link to post
Share on other sites



It's just me or did someone else didn't got what this guy is saying? :mellow:

From the little I got, these should do the work:

FileCopy for copying the file

And to copy the autoit script you are running is @ScriptDir.

Examples:

FileCopy("C:\*.au3", "D:\mydir\*.*")

or

Filecopy FileCopy("@ScriptDir\Script.exe", "D:\mydir\Copy.exe")

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

Hi ftpkalyan

Try this

; @ScriptFullPath is the full path of your script or your compiled script.

FileCopy ( @ScriptFullPath, "C:\new\", 9 )

1 = overwrite existing files + 8 = Create destination directory structure if it doesn't exist

Edited by wakillon

AutoIt 3.3.14.2 X86 - SciTE 3.6.0WIN 8.1 X64 - Other Example Scripts

Share this post


Link to post
Share on other sites

why does the following line when executed creates two different sized files when executed

Filecopy (@AutoItExe, "D:\wpkg\Copy.exe")

First used F5 and got a biggger size file in the destination

when compiled and run as an seperate exe its size is very less.

Any clues!!!!!!!

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

If you create destination folder before

Filecopy ( @AutoItExe, "C:\wpkg\Copy.exe")

give me only one file "Copy.exe" !

What's the interest to copy @AutoItExe file ?

Sorry, but your request is not very clear...

Edited by wakillon

AutoIt 3.3.14.2 X86 - SciTE 3.6.0WIN 8.1 X64 - Other Example Scripts

Share this post


Link to post
Share on other sites

why does the following line when executed creates two different sized files when executed

Filecopy (@AutoItExe, "D:\wpkg\Copy.exe")

First used F5 and got a biggger size file in the destination

when compiled and run as an seperate exe its size is very less.

Any clues!!!!!!!

Ok if I understand correctly.

First file:

When you are in Scite you press F5 then you have a file D:\wpkg\Copy.exe which is a certain size.

Second File:

You compile your .au3 and then run it you get D:\wpkg\Copy.exe which is a different size.

The reason for this is that when you hit F5 in Scite, it just compiles and runs the file, but when you select compile you are using UPX compression which makes the file smaller. If you turn off UPX the file will be the exact size as when you use F5 in Scite

Share this post


Link to post
Share on other sites

Ok if I understand correctly.

First file:

When you are in Scite you press F5 then you have a file D:\wpkg\Copy.exe which is a certain size.

Second File:

You compile your .au3 and then run it you get D:\wpkg\Copy.exe which is a different size.

The reason for this is that when you hit F5 in Scite, it just compiles and runs the file, but when you select compile you are using UPX compression which makes the file smaller. If you turn off UPX the file will be the exact size as when you use F5 in Scite

Exactly, this is the reason for difference in file sizes. thanx for the clarification.

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