Discussion forum for all Windows batch related topics.
Moderator: DosItHelp
-
rasil
- Posts: 31
- Joined: 23 Apr 2020 13:05
#1
Post
by rasil » 28 Feb 2021 10:02
Hi,
I have a batch file that connects to a ftp server then makes a folder and deletes a (
%username%.txt) But when I execute the file it just stays blank with no response but if I let it run it says
connection timed out note that the ftp server is working fine and in can connect to it using an online ftp file manager. Sometimes the batch file works but mostly it doesn't am I doing something wrong?
Batch file:
Code: Select all
@echo off
echo user username> ftpcmdq.dat
echo password>> ftpcmdq.dat
echo cd htdocs>> ftpcmdq.dat
echo mkdir %username%>> ftpcmdq.dat
echo cd %username%>> ftpcmdq.dat
echo del %username%.txt>> ftpcmdq.dat
ftp -n -s:ftpcmdq.dat FTP.COM
del ftpcmdq.dat
exit
-
Squashman
- Expert
- Posts: 4486
- Joined: 23 Dec 2011 13:59
#2
Post
by Squashman » 28 Feb 2021 11:24
Why test with an online ftp manager?
Why not test with manually typing the commands at a console window or even just using a free ftp client like Filezilla. Note that the Windows FTP client does not support passive mode.
-
rasil
- Posts: 31
- Joined: 23 Apr 2020 13:05
#3
Post
by rasil » 28 Feb 2021 14:31
Squashman wrote: ↑28 Feb 2021 11:24
Why test with an online ftp manager?
Why not test with manually typing the commands at a console window or even just using a free ftp client like Filezilla. Note that the Windows FTP client does not support passive mode.
hi,
I checked with ftp client and it successfully connected but right after i posted this thread the script started working and it was connecting but it only worked for 10 minutes and it seems as if it just works for 10 minutes then stops for no apparent reason when its not working through batch I can still connect to it using the ftp client. When it is in its broken state and i try to connect to it just by typing through the console it says
connection timed out. I found little to no information on this issue, is it a problem with my isp?
And also can you explain what do you mean by
the Windows FTP client does not support passive mode.
Rasil
-
rasil
- Posts: 31
- Joined: 23 Apr 2020 13:05
#4
Post
by rasil » 01 Mar 2021 09:03
Just a small update:
is it a problem with my isp?
So it turns out that by using a vpn i can successfully connect to the ftp server using ftp.exe. so it has to be my isp (british telecom). But this doesn't explain everything why does Winscp and filezilla work without an vpn?
Rasil