|
-
Dec 6th, 2003, 12:46 PM
#1
Thread Starter
Fanatic Member
FTP DOS Commands
Hi everybody,
I'm trying to use DOS commands to perform FTP actions. I simply make a BAT file and run it with VB. This works with all actions as far as I have tested, but not with FTP functions... 
It only seems to be executing the first line...
This the the BAT file (user name and password are correct):
Code:
ftp garegozers.net
user gg-thevader ******
dir
Can anyone help me with this...?
Last edited by TheVader; Dec 10th, 2003 at 02:27 PM.
Author for Visual Basic Web Magazine
-
Dec 6th, 2003, 02:09 PM
#2
Frenzied Member
You do realize you've left your password there right?
-
Dec 6th, 2003, 02:53 PM
#3
Thread Starter
Fanatic Member
Originally posted by Shawn N
You do realize you've left your password there right?
Yes, I do, thanks. And I don't mind anyone visiting, there's only crap on that server anyway.
(and '******' isn't my usual password anyway )
Last edited by TheVader; Dec 10th, 2003 at 02:28 PM.
Author for Visual Basic Web Magazine
-
Dec 7th, 2003, 12:37 AM
#4
What the bat file is doing is starting a FTP session and then waits for that to finish before going to line 2.
What you want todo is to send the FTP commands to the FTP prompt and not to Windows command prompt. Save all FTP commands to a text file and use this in your BAT file:
VB Code:
FTP -s:c:\thePath\theNameOfTheTextFile.txt
-
Dec 7th, 2003, 04:22 AM
#5
Fanatic Member
There's this nifty built in feature called the help switch....
FTP /?
It SHOULD tell you the commands available and how to use them.
I'm sure the msdn.microsoft.com site has helpfull info.
Search engines.. Gota love e'm.
-
Dec 7th, 2003, 05:03 PM
#6
Thread Starter
Fanatic Member
Thanks a lot, Joachim.
Author for Visual Basic Web Magazine
-
Dec 7th, 2003, 07:04 PM
#7
Banned
You should use K-FTP instead.
( http://www.katarncorp.com/?kftp )
Kyle
-
Dec 8th, 2003, 02:47 PM
#8
Thread Starter
Fanatic Member
Is there any way I can keep an FTP session active with the CMD? So e.g. first I log on to the server with a BAT and TXT file, then later on I want to change the directory, or download a file or something like that. But since you can't add commands 'on the fly' I can't figure out how to do that. 
Thanks for any help.
Author for Visual Basic Web Magazine
-
Dec 8th, 2003, 03:07 PM
#9
Frenzied Member
STOP SPAMMING.
-
Dec 8th, 2003, 03:20 PM
#10
Banned
Ain't spamming. Just giving solutions.
-
Dec 8th, 2003, 03:21 PM
#11
Frenzied Member
That is not a solution. That is an advertisement for your software. The user is trying to write their own software, not use something that has already been made.
Again I say, stop spamming or I'll report you. I'm not the only person that has warned you about this.
-
Dec 8th, 2003, 03:48 PM
#12
Banned
-
Dec 8th, 2003, 03:49 PM
#13
Addicted Member
i don't think any page with a "Buy Now" Button would qualify as a solution to an answer. Considering your avatar is the same as the company's logo.
C++/VB6&.NET/QBasic/HTML/PHP/MySQL/SQLServer2k
I'm the guy your little brother looks a lot alike. Tell your mom i said thanks.
naked in vegas
-
Dec 8th, 2003, 03:50 PM
#14
Frenzied Member
Giving someone a shareware OCX is not the same as answering someone's question or responding with how someone could attack a problem.
-
Dec 8th, 2003, 04:44 PM
#15
-
Dec 8th, 2003, 07:28 PM
#16
Thread Starter
Fanatic Member
Thanks, I'll check out the article. Yeah, i'm using FTP in my app; I'm now using the Inet Control, but it's annoyingly limited and the Winsock control is very difficult to master; so I thought this would be an easy solution...
Author for Visual Basic Web Magazine
-
Feb 25th, 2004, 06:10 PM
#17
Fanatic Member
This is the prompt:
c:\> FTP -s:c:\upload ftp.serverx.net
These are the lines of the file:
USER myusername
PWD mypassword
cd /web
lcd c:\brafpweb
send c:\brafpweb\net-reach.htm net-reach.htm
close
quit
Connected to serverx
220 ProFTPD 1.2.5 Server (ProFTPD) [serverx]
User (serverx none)):
331 Password required for USER.
530 Login incorrect.
Login failed.
ftp> mypassword
Invalid command.
ftp> cd /web
530 Please login with USER and PASS.
ftp> lcd c:\brafpweb
Local directory now C:\brafpweb.
ftp> send c:\brafpweb\net-reach.htm net-reach.htm
ftp> close
221 Goodbye.
ftp> quit
Why am I not getting this right?? This would be useful for maintaining a website by having an automated upload each evening to reflect changes done to the site.
Thanks
-
Feb 25th, 2004, 06:14 PM
#18
Banned
Can't you just use the FTP API's ?
FtpCreateDirectory
FtpDeleteFile
FtpFindFirstFile
FtpGetCurrentDirectory
FtpGetFile
FtpPutFile
FtpRemoveDirectory
FtpRenameFile
FtpSetCurrentDirectory
InternetConnect
Just a few API's you can use..
If you download the API-Guide, it gives you examples for each one of them...
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|