Jump to content

filecopy


Recommended Posts

Hello!

I have a webplace where customers login and download files.

I now want them to download files to their disk and run an autoit-script.

I have problems with downloading the files from autoit-script:

the code in autoit-script/exe:

$dir = ("C:\Program\Friendly" )

FileCopy("nordr.dbf", $dir, 1)

FileCopy("nordr.dbt", $dir, 1)

FileCopy("nscript.dbf", $dir, 1)

FileCopy("nscript.dbt", $dir, 1)

Is it possible for users to download autoit-exe file which run the filecopy-command and store files on

computer-harddisk, i can't get it to function.

The user today click on autoit-exe-file which works and install things in the customers program.

:)

Link to comment
Share on other sites

Look at the Fileinstall function to include these other files right in the script exe.

Fileinstall("c:\autoit\scripttobuild\nordr.dbf", $dir)

Note the first value can't be a variable.

But when i am on the web i have no c: directory, so where do i copy from?

:)

Link to comment
Share on other sites

Yes but are you using http, ftp, or something else?

Today users have to click manually on four files on the web after login, save as on local disk, ex c:\temp,

then on web click on autoit-exe file which run install on a program at users c:\program directory.

I want the process to copy the four files on web to c:\temp and then run autoit-exe file on web which

uses the four files on c:\temp and install to c:\program.

:)

Link to comment
Share on other sites

But when i am on the web i have no c: directory, so where do i copy from?

:)

Fileinstall("c:\autoit\scripttobuild\nordr.dbf", $dir)

With Fileinstall It's the C: drive of the computer used to compile the script (your computer). With the example code I gave. when the script is built to an exe, the compiler will take the file from your hard drive: "c:\autoit\scripttobuild\nordr.dbf" and include it in the script exe file. Then when the exe is run, it will copy that file to the location in the variable $dir.

This is a good way to go as then your users only have to download one self contained file.

If you want the program to independently download a file from a website, look at the Inetget function:

InetGet ( "http://www.autoitscript.com/file.dbf" ,$dir)

however this relies on the user having internet explorer configured properly and have an active internet connection.

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...