autohotkey ftp下载文件和文件夹

  1. 下载 wget.exe
  2. autohotkey v2 执行下面脚本
  3. 参数说明
    • src_path 目标文件和目标目录
    • 下载完成后会打开目标文件夹
wget('a')
wget(src_path := '', exe := 'G:\我的AHK程序\我的工程\wget\wget.exe', ftp := 'ftp://101.13.34.55/', obj_path := A_MyDocuments '\tmp-zzzzzzzzzzzzzzz')
{
    try
    {
        FileRecycle(obj_path)
    }
    cut_number := StrSplit(src_path, '/').Length
    cmd := Format('"{}" -nH -m  -r --cut-dirs={}  {}{} -P {}', exe, cut_number, ftp, src_path, obj_path)
    RunWait(cmd)
    Run(obj_path)
}
posted @ 2023-02-24 14:02  xzsxzxs  阅读(55)  评论(0编辑  收藏  举报