Jump to content

Ftp:// download from script


Recommended Posts

Hi Guys,

I want to run a script daily so it pulls down the latest sdat from Mcafee's ftp page. how can I do this?

the page is ftp://ftp.mcafee.com/pub/antivirus/superdat/intel/ the sdat file name changes name each day so i need it to download SDAT*.exe

No login name or password is required for the ftp: page..

ive tried this with my little knowledge of autoit but it dosent work.

filecopy("ftp://ftp.mcafee.com/pub/antivirus/superdat/intel/sdat*.exe", "C:\Documents and Settings\name\Desktop")

Link to comment
Share on other sites

ive created this now from looking at the function references..

InetGet("ftp://ftp.mcafee.com/pub/antivirus/superdat/intel/Sdat5140.exe", "C:\Documents and Settings\name\Desktop", 1, 1)

While @InetGetActive
  TrayTip("Downloading", "Bytes = " & @InetGetBytesRead, 10, 16)
  Sleep(250)
Wend

MsgBox(0, "Bytes read", @InetGetBytesRead)

it dosent seem to work & fulls over with a bytes read -1

Edited by chiners_68
Link to comment
Share on other sites

This works

InetGet("ftp://ftp.mcafee.com/pub/antivirus/superdat/intel/Sdat5140.exe", @DesktopDir & "\test.exe", 1, 1)

While @InetGetActive
  TrayTip("Downloading", "Bytes = " & @InetGetBytesRead, 10, 16)
  Sleep(250)
Wend

MsgBox(0, "Bytes read", @InetGetBytesRead)

so I would check and see if "C:\Documents and Settings\name\Desktop" exists before trying to put a file there... Do you really have a user named "name"?

Link to comment
Share on other sites

danwilli,

No, I dont have a user named 'name'. i just renamed that on the post as I didnt want to display the persons name.

tried your scrit which you said works but still get the same bytes read -1.

InetGet("ftp://ftp.mcafee.com/pub/antivirus/superdat/intel/Sdat5140.exe", @DesktopDir & "\test.exe", 1, 1)

While @InetGetActive

TrayTip("Downloading", "Bytes = " & @InetGetBytesRead, 10, 16)

Sleep(250)

Wend

MsgBox(0, "Bytes read", @InetGetBytesRead)

Ive tried to the root of C:\ but that still dosent work.

Edited by chiners_68
Link to comment
Share on other sites

danwilli,

No, I dont have a user named 'name'. i just renamed that on the post as I didnt want to display the persons name.

tried your scrit which you said works but still get the same bytes read -1.

Ive tried to the root of C:\ but that still dosent work.

@InetGetBytesRead = the number of bytes downloaded, or -1 if there has been an error.

I suppose the error is that InetGet is no longer active. The script works for me.

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