Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using FTP script and rename files at client

Status
Not open for further replies.

mydisney

Programmer
May 7, 2007
55
US
I have a ftp script that connects to a client site and picks up files using wild card like *.asc. I need to use wild card since files that are placed in the folder are dynamically named based upon date and time. This works fine. Next thing I need to do (in the ftp script) is either 1. rename all files to a different extension or 2. move them to a sub directory so I do not pick them up again. Can anyone give me some cluse how to do this please. I have tried to use wild card in the rename command but it does not rename unless I explicitely name the file and the extension.

Set objMyFile = objFSO.CreateTextFile(strFTPScriptFileName, True)
objMyFile.WriteLine ("open " & strFTPServerName)
objMyFile.WriteLine (strLoginID)
objMyFile.WriteLine (strPassword)
objMyFile.WriteLine ("cd " & strFTPServerFolder)
objMyFile.WriteLine ("bin")
objMyFile.WriteLine ("lcd " & strLocalFolderName)
objMyFile.WriteLine ("prompt")
objMyFile.WriteLine ("mget " & strFilePut)
objMyFile.Writeline ("rename " & "/*.sav" & " " & "*.asc")
objMyFile.WriteLine ("disconnect")
objMyFile.WriteLine ("bye")
objMyFile.Close
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top