批处理学习,持续更新。。。

来源:互联网 发布:淘宝卖家的需求分析 编辑:程序博客网 时间:2024/05/16 23:36
  1. 深入理解shift命令的案例:
    范例
    以下批处理文件 Mycopy.bat 显示了如何使用包含任意数目批处理参数的 shift 命令。该批处理文件将一列文件复制到特定的目录。批处理参数由目录和文件名参数表示。
    @echo off
    rem MYCOPY.BAT copies any number of files
    rem to a directory.
    rem The command uses the following syntax:
    rem mycopy dir file1 file2 …
    set todir=%1
    :getfile
    shift
    if “%1”==”” goto end
    copy %1 %todir%
    goto getfile
    :end
    set todir=
    echo All done

1 0
原创粉丝点击