FTP - Slette alle zip filer
Hej,Jeg vil gerne slette alle zip filer. altså *.zip
****************
Option Explicit
Dim objFSO, objMyFile, objShell, strFTPScriptFileName
strFTPScriptFileName = "D:\links.php"
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objMyFile = objFSO.CreateTextFile(strFTPScriptFileName, True)
objMyFile.WriteLine ("open 172.16.21.6")
objMyFile.WriteLine ("1") ' Login
objMyFile.WriteLine ("1") ' Password
objMyFile.WriteLine ("cd F:\")
objMyFile.WriteLine ("binary")
objMyFile.WriteLine ("del *.zip")
objMyFile.WriteLine ("lcd D:\")
objMyFile.WriteLine ("put " & "1.txt")
objMyFile.WriteLine ("bye")
objMyFile.Close
Set objFSO = Nothing
Set objMyFile = Nothing
'The following code executes the FTP script. It creates a Shell object and run FTP program on top of it.
Set objShell = WScript.CreateObject( "WScript.Shell" )
objShell.Run ("ftp -s:" & chr(34) & strFTPScriptFileName & chr(34))
Set objShell = Nothing
****************
... men hvis jeg bruger "*.zip" melder den at: *.zip not found or permission problems.
Hvis jeg skriver hele filens navn, virker det...
Håber nogen kan hjælpe.