如何通过命令提示符列出Windows TFTP服务器的目录和文件?

8
我已经在我的Windows 7电脑上安装了Tftpd32软件。我正在运行Windows个人计算机上的TFTP服务器,而且TFTP主目录中有一些目录和文件。我需要从Windows命令提示符中显示TFTP服务器的目录和文件?如何显示TFTP服务器的目录和文件夹?
C:\Users\user1>tftp

Transfers files to and from a remote computer running the TFTP service.

TFTP [-i] host [GET | PUT] source [destination]

  -i              Specifies binary image transfer mode (also called
                  octet). In binary image mode the file is moved
                  literally, byte by byte. Use this mode when
                  transferring binary files.
  host            Specifies the local or remote host.
  GET             Transfers the file destination on the remote host to
                  the file source on the local host.
  PUT             Transfers the file source on the local host to
                  the file destination on the remote host.
  source          Specifies the file to transfer.
  destination     Specifies where to transfer the file.


C:\Users\user1>
2个回答

8
TFTP是一种极简文件传输协议,没有提供列出远程文件的子命令。
但Tftpd32有一个解决方法,它可以为您正在访问的目录创建一个“dir.txt”文件。在Tftpd32的TFTP设置中启用该选项。现在,当TFTP客户端请求“dir.txt”文件时,服务器将生成并发送一个列出基本目录内容的文件。
如果您想使用更高级的功能,则必须使用FTP。

2

您可以从安装目录中的tftpd32.ini文件中获取Tftpd32的“BaseDirectory”(C:\ Program Files \ Tftpd32)。通常在打开Tftpd32应用程序时,它将以此目录作为基本目录打开。并且从脚本中,

  • 将目录更改为从tftpd32.ini中获取的基本目录
  • 从该目录执行“dir”命令,以获取子目录和文件列表。

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接