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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need help with FTP

Status
Not open for further replies.

jcash35010

Programmer
Jul 22, 2003
21
0
0
US
I am FTP a file from a NT to a unix. I need some help determining how to set this up, and I don't know how to do it. My setup is as below....

ftp workbrain
address ftp to /wbx/home/dwn/tpmpay
username tpmpay
password tpmpay
filename tpmpay.txt

Thanks for any advice and help you can give me....
 
An approach is to create a ftp-commands file and then launch ftp, something like this.
1) myftp.txt:
Code:
user tpmpay tpmpay
cd /wbx/home/dwn/tpmpay
put tpmpay.txt
bye
2) In your VBS file:
Code:
Set S=WScript.CreateObject("WScript.Shell")
S.Run "ftp -v -n -s:\path\to\myftp.txt workbrain"

Hope This Help
PH.
 
Ok, I am having a problem. Below is my code in my script. I have to check to see if the file is there before I try to ftp. The file may not always be there, however when I run this I am getting an object required " error on line 9.

Any advice?

Dim FSO, File, Folder, FolderContents, objLogFile, CopyFile, SourceFile, SourceLine
dim CurrentFile
Dim FileDate, SystemDate
Dim objFTP, objTextFile, oScript, oScriptNet, oFileSys, oFile, strCMD, strTempFile, strCommandResult

Set FSO = CreateObject("Scripting.FileSystemObject")
Set Folder = FSO.GetFolder("E:\TPM\PAYFILES\")

If Ucase(File.Name) = "TPMPAYFILE.TXT" then
Set S=WScript.CreateObject("WScript.Shell")
S.Run "ftp -v -n -s:\path\to\ftpworkbrain.txt workbrain"
File.Delete()
End IF

Set FSO = nothing
Set Folder = nothing
CurrentFile.Close
Set CurrentFile = NOTHING
 
Try something like this:
Code:
Set FSO=CreateObject("Scripting.FileSystemObject")
If FSO.FileExists("TPMPAYFILE.TXT") Then
  Set S=WScript.CreateObject("WScript.Shell")
  S.Run "ftp -v -n -s:\path\to\ftpworkbrain.txt workbrain" 
  FSO.DeleteFile("TPMPAYFILE.TXT")
End If

Hope This Help
PH.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top