Oops sorry
Here is the code again
Dim WshShell, curDir, wShell, file
Set wShell = WScript.CreateObject("Shel
Set WshShell = WScript.CreateObject("WScr
Set FileSystem = WScript.CreateObject("Scri
Set OutPutFile = FileSystem.OpenTextFile("s
file = InputBox ("Which file will you upload?","File adder")
OutPutFile.WriteLine "open [ftp server]" 'Connects to the ftp server
OutPutFile.WriteLine "[username]"
OutPutFile.WriteLine "[password]"
OutPutFile.WriteLine "cd [folder]"
OutPutFile.WriteLine "put " & file 'Adds the file to the ftp server
OutPutFile.WriteLine "bye" 'Quit.
OutPutFile.Close
curDir = WshShell.CurrentDirectory
wShell.Open curDir & "\batfile.bat"
Set wShell = Nothing
Set WshShell = Nothing
Set FileSystem = Nothing
Set OutPutFile = Nothing
WScript.Quit(0)
Main Topics
Browse All Topics





by: ramesh12Posted on 2004-03-30 at 11:23:26ID: 10716677
Use something like this
l.Applicat ion") ipt.Shell" ) pting.File SystemObje ct") ometextfil e.txt",2,T rue)
Dim WshShell, curDir, wShell, file
Set wShell = WScript.CreateObject("Shel
Set WshShell = WScript.CreateObject("WScr
Set FileSystem = WScript.CreateObject("Scri
Set OutPutFile = FileSystem.OpenTextFile("s
file = InputBox ("Which file will you upload?","File adder")
OutPutFile.WriteLine "open [ftp server]" 'Connects to the ftp server
OutPutFile.WriteLine "[username]"
OutPutFile.WriteLine "[password]"
OutPutFile.WriteLine "Lcd [folder]"
OutPutFile.WriteLine "Get " & file 'Adds the file to the ftp server
OutPutFile.WriteLine "bye" 'Quit.
OutPutFile.Close
Set wShell = Nothing
Set WshShell = Nothing
Set FileSystem = Nothing
Set OutPutFile = Nothing
WScript.Quit(0)