mIRC Home    About    Download    Register    News    Help

Print Thread
S
shawnrgr
shawnrgr
S
i wanna use mirc to connect to ftp to get a list of files in certian dirs on the ftp. is this possible in mirc?

Joined: Dec 2002
Posts: 1,893
O
Hoopy frood
Offline
Hoopy frood
O
Joined: Dec 2002
Posts: 1,893
Not with mirc, but with ftp.exe. Create a file called cmd.txt in your mirc folder, open it with notepad and put there the following (remember to omit my comments)
  • [FTP host]
    open ftp.cdrom.com
    [user]
    anonymous
    [pass]
    anony[/i]@mouse.com
    [desired directory]
    cd pub
    ls
    [leave the > there or 'quit' will appear in your output file]
    quit >
Now type this command:
  • /run -n command.com /c ftp -v -s:cmd.txt|find /v ">">out.txt
(you may want to use cmd.exe instead of command.com depending on your OS)

After it's done running, you'll have an out.txt file in your mirc folder, containing the ftp directory listing.

laugh

Related links:
Using FTP through mIRC without sockets
Extended /run
And don't forget ftp -? and find /? in the DOS command prompt.

C
Commander
Commander
C
i got this to work but when i tried another port apart from 21 couldnt connect i tried open ftp.cdrom.com:1234 but that didnt work any ideas?

Joined: Dec 2002
Posts: 1,893
O
Hoopy frood
Offline
Hoopy frood
O
Joined: Dec 2002
Posts: 1,893
Change : to a space, as follows
  • open ftp.cdrom.com 1234

C
Commander
Commander
C
thank you

C
Commander
Commander
C
It is possible to do this with SSL-enabled FTP's?

Joined: Dec 2002
Posts: 3,015
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 3,015
It is possible, but you will need an SFTP client such as PSFTP.

As you are using a different program you will no longer use the file Online gave, and you will need a new command. The output will also come in a very different format. The new command is:

//run -n command.com /C echo cd [color:green]/home $chr(10) ls $chr(124) psftp user@host -pw password > out.txt[/color]

Here is a sample output of the file your script will need to be able to understand:
Code:
Remote working directory is /home/user
psftp> Remote directory is now /home
psftp> Listing directory /home
drwxrwsr-x    6 root     staff        4096 Sep 14 07:01 .
drwxr-xr-x   22 root     root         4096 Sep 12 07:31 ..
drwx------   12 user     group        4096 Sep 15 12:08 user
psftp> quit


Link Copied to Clipboard