如何从命令提示符列出 windows tftp 服务器目录和文件?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/18225182/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-09 10:47:03  来源:igfitidea点击:

How to list the windows tftp server directories and files from command prompt?

windowswindows-7commandtftp

提问by gmanikandan

I have installed Tftpd32 software in my windows 7 pc. I have running tftp server on my windows pc and tftp home directory has few directories and files. I have to display the tftp servers directories and files from windows command prompt ? How to display the tftp server directories and folders ?

我已经在我的 Windows 7 电脑上安装了 Tftpd32 软件。我在 Windows pc 上运行 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>

回答by Synck

TFTP is a minimal file transfer protocol that does not provide subcommands to list remote files.

TFTP 是一种最小文件传输协议,它不提供列出远程文件的子命令。

But Tftpd32 has a workaround, it can create a "dir.txt" file for the directory you're accessing. Enable the optionin the TFTP settings of Tftpd32. Now when a TFTP client requests the "dir.txt" file, the server will generate and send a file that lists the content of the base directory.

但是 Tftpd32 有一个解决方法,它可以为您正在访问的目录创建一个“dir.txt”文件。在 Tftpd32 的 TFTP 设置中启用该选项。现在,当 TFTP 客户端请求“dir.txt”文件时,服务器将生成并发送一个列出基本目录内容的文件。

You'll have to use FTP if you want to use more advanced features.

如果您想使用更高级的功能,则必须使用 FTP。

回答by bugger

You can get "BaseDirectory" of Tftpd32 from tftpd32.ini in the installed directory. (C:\Program Files\Tftpd32). Typically on opening Tftpd32 application, it will open with this directory as the base one. And from a script,

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

  • Change the directory to the base directory grepped from tftpd32.ini
  • Do a "dir" from that directory, to obtain the list of sub-directories and files.
  • 将目录更改为从 tftpd32.ini grepped 的基本目录
  • 从该目录执行“dir”,以获取子目录和文件的列表。