Skip to main content
  • Place orders quickly and easily
  • View orders and track your shipping status
  • Create and access a list of your products
  • Manage your Dell EMC sites, products, and product-level contacts using Company Administration.

使用批处理文件检查文件是否存在。

Summary: 本文介绍了实施批处理文件以检查文件是否存在的步骤。

This article may have been automatically translated. If you have any feedback regarding its quality, please let us know using the form at the bottom of this page.

Article Content


Symptoms

使用批处理文件例程检查是否存在文件。

您可以从命令运行批处理文件,以检查文件是否存在,然后在到达时执行例程。

:在运行批处理文件之前,需要先安装 sleep 程序,并随 Windows NT Resource 工具包提供。
 

Cause

Resolution

下面是一个示例,请执行以下步骤以创建例行批处理文件。

  1. 单击“开始”,然后单击“运行”
  2. 在 " 打开 " 字段中,键入 CMD
    打开命令提示符窗口
  3. 键入 edit test .bat 并按 < enter >。

    注:Word test 可能会替换为另一个词。
  4. 键入exit,然后按<Enter>键。
  5. 键入 是否存在 c:\ftp\ftpfile.txt goto 执行 ,然后按 < enter >。

    注:文件 ftpfile 可能替换为其他文件。
  6. 键入 sleep 200 并按 < enter >。

    注:秒数可能从 200 increaed 或减少。
  7. 键入 goto check_for_file_existence 然后按 < enter >。
  8. 键入exit,然后按<Enter>键。

:此例程每200秒检查一次 ftpfile。当通过 FTP 将文件发送到计算机时,如果需要运行程序,则此类例程很有用。

 


 

Article Properties


Affected Product

Software

Last Published Date

20 Apr 2021

Version

4

Article Type

Solution