3. 编辑批处理文件,置于WINDOWS目录下(本示例批处理文件为gotoy.bat,目的是将任意文件拷贝到y:\software目录下运行):
@echo off&setlocal EnableDelayedExpansion
if exist "Y:\SoftWare\mld.txt" Del /f /q Y:\SoftWare\mld.txt
nircmd.exe clipboard set ""%1""
rem 此处必须用双双引号,否则目录或文件名中有空格时无法完整复制。
nircmd.exe clipboard addfile "Y:\SoftWare\mld.txt"
nircmd.exe clipboard clear
For /F "delims=/" %%i in (Y:\SoftWare\mld.txt) do Xcopy "%%i" Y:\SoftWare /D /Y
For /F "delims=/" %%a in (Y:\SoftWare\mld.txt) do start "" "y:\software\%%~nxa"
Del /f /q Y:\SoftWare\mld.txt
exit