从FTP下载完一个文件之后并创建桌面快捷方式,但会出来两个窗口,求大神指定,希望下载完之后自运退出并创建桌面快捷方式- @echo off
- set ftpUser=Anonymous
- set ftpIP=192.0.0.0
- set LocalFolder=D:\
- set ftpFile="%temp%\TempFTP.txt"
- set "SrcFile=D:\123.exe"
- set "Args=-s -t 2"
- set "LnkFile=123.LNK"
- call :CreateShort "%SrcFile%" "%Args%" "%LnkFile%"
- pause & goto :eof
-
- ::Arguments 目标程序参数
- ::Description 快捷方式备注
- ::FullName 返回快捷方式完整路径
- ::Hotkey 快捷方式快捷键
- ::IconLocation 快捷方式图标,不设则使用默认图标
- ::TargetPath 目标
- ::WindowStyle 窗口启动状态
- ::WorkingDirectory 起始位置
-
- :CreateShort
- mshta VBScript:Execute("Set a=CreateObject(""WScript.Shell""):Set b=a.CreateShortcut(a.SpecialFolders(""DeskTop"") & ""\%~3""):b.TargetPath=""%~1"":b.WorkingDirectory=""%~dp1"":b.Arguments=""%~2"":b.Save:close")
- >"%ftpFile%" (
- echo,%ftpUser%
- echo cd "%ftpFolder%"
- echo lcd "%LocalFolder%"
- echo bin
- echo ! echo 正在下载...
- echo mget *.*
- echo ! echo 下载结束...
- echo ! ping -n 10 127.1 ^>nul
- echo bye
- )
- start ftp -v -i -s:"%ftpFile%" %ftpIP%
复制代码
|