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

Would you help me ?

Status
Not open for further replies.

php3390

Technical User
Feb 5, 2005
13
0
0
SA
Hi all,

Using VB6, I wrote a vb code that creates ftp batch file and run it as follwoing:

**********************************
Private Sub start_ftp_Click()
' Create the text file that ftp takes the commands from

Open "c:\test.txt" For Output As #1

Print #1, "user myusername"
Print #1, "mypass"
Print #1, "ascii"

'Path on the server
'current path, default path

' Copy the file from pc to server and rename it.
Print #1, "put test.txt ftptest.txt"
Print #1, "bye"
Close #1

' Create a batch file and write the code for FTP
Open "C:\FileName.bat" For Output As #2

Print #2, "ftp -v -n -i -g -s:test.txt myhost-ip"

Close #2

'Run the batch file
Shell "C:\FileName.bat", vbHide
MsgBox "done"


End Sub

****************************************

The script is creating both files but the run doesn't work! when I run the batch file manually it works properly? can any of you help me in this please....


Regards,
Me
 
Print #1, "put test.txt ftptest.txt"
Change the source file name becuase that file open while tranfering


and
change the FTP argument like below
ftp -v -n -i -g -s:test.txt myhost



thanks
maii
 
Thanks maii

I got it woring now..
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top