Thanks for all the help so far.

Everyone seems to forget that we are making a connection to a linux server.
I know for sure that the problem is that the script cant find the location of the file.
This file I want to download from the linux ftp server.
The code that should be adjusted is: Dir("/u/prod/version.*")

The problem is that first the ftp connection should be open.
And after the connection is made I would like to say where the file should be downloaded.

I don't know is the function ftpget() can be used for my cause.

This is my code so far:
 Code:
 
$CopyTo = $locatie + "\temp\" + @WKSTA
$gebruikersnaam = "user"
$wachtwoord = "123456"

CALL \\server\netlogon\ftpget.udf
FTPget("10.0.0.1" + Dir("/u/prod/version.*"), "$CopyTo", "$gebruikersnaam", "$wachtwoord")

? "$CopyTo"