
February 1st, 2008, 06:43 AM
|
|
Registered User
|
|
Join Date: Feb 2004
Posts: 4
Time spent in forums: 1 h 18 m 51 sec
Reputation Power: 0
|
|
|
Need to set-up Windows ftp utility w/variable for a file name.
I am trying to write an ftp utility in wsh or vbs that will go out to the site, log in, ftp the latest files and close. I have a script that works, however I need to substitute a string variable for the file name. This utility will be used sporadically (it's a backup to an automated process) and the file names include the date and time. I can easily create a string with the correct filename using the date function, but I can't figure out how to get the utility to use the string variable. Below is a sample of the code that works (albeit with the filename).
Is there a way to use a variable in this code, or is there another way to do it? I'm not married to the code used here, so if a total new approach is needed I'm fine with that.
Dim WshShell
Set WshShell = CreateObject("WScript.Shell")
WshShell.run "FTP -i -s:C:\Temp\testftp\ftpfile.txt",1
Set WshShell = nothing
below is the contents of the text file ftpfile.txt
open ftpsite address
username
password
mget FILE_0123_20080131_20080131*.CSV
quit
Any help would be greatly appreciated!
|