After doing a ftp and mget (download multiple files) I need to rename files that were downloaded. I have a script that works on my local machine (see below) but does not work on the client machine which is a Unix box. The error I get is that specified path was not found. How do I specify a path on a Unix box that vb script will accept?
'Rename .asc file extensions to .bak after ftp download and move files to backup folder
Dim filesys, file, folderName, objFile, folderObj, fileColl, objRegExp, newFile
Set filesys = CreateObject("Scripting.FileSystemObject")
folderName = "c:\mylocalfolder\mylocafiles\"
Set folderObj = filesys.GetFolder(folderName)
Set fileColl = folderObj.Files
Set objRegExp = New RegExp
objRegExp.Pattern = "^(t)(.*\.)txt$"
objRegExp.IgnoreCase = True
For Each objFile In fileColl
If objRegExp.Test(objFile.Name) Then
newFile = objRegExp.Replace(objFile.Name, "$1$2bak")
filesys.MoveFile objFile, folderName & "backup\" & newFile
End If
Next
'Rename .asc file extensions to .bak after ftp download and move files to backup folder
Dim filesys, file, folderName, objFile, folderObj, fileColl, objRegExp, newFile
Set filesys = CreateObject("Scripting.FileSystemObject")
folderName = "c:\mylocalfolder\mylocafiles\"
Set folderObj = filesys.GetFolder(folderName)
Set fileColl = folderObj.Files
Set objRegExp = New RegExp
objRegExp.Pattern = "^(t)(.*\.)txt$"
objRegExp.IgnoreCase = True
For Each objFile In fileColl
If objRegExp.Test(objFile.Name) Then
newFile = objRegExp.Replace(objFile.Name, "$1$2bak")
filesys.MoveFile objFile, folderName & "backup\" & newFile
End If
Next