您好我试图在.rar
上下载mediafire
存档,但它似乎无法正常工作,文件无法访问特定文件夹
“C:\马铃薯”
这是我的代码:
@Echo off
echo download press any key
pause
bitsadmin.exe /transfer "JobName"
http://download1142.mediafire.com/sxd533x3fosg/ymr5y2r0yax2fx8/minecraft+generator.zip C:\Potato.exe
pause
答案 0 :(得分:1)
尝试这样的事情:
@echo off
setlocal EnableDelayedExpansion
set "infile=http://download1142.mediafire.com/3b1mz9yb72tg/ymr5y2r0yax2fx8/minecraft+generator.zip"
set "outfile=Potato.zip"
cd "C:\"
echo download press any key
pause
powershell.exe -Command (new-object System.Net.WebClient).DownloadFile('"%infile%"','"%outfile%"') | findstr "Exception error" >nul 2>nul
set "downloadComplete=%errorlevel%"
if %downloadComplete% neq 1 echo Something went wrong, please try again
if %downloadComplete% neq 1 pause
if %downloadComplete% neq 1 goto :eof
unzip "%outfile%" "minecraft generator.zip" >nul
unzip "minecraft generator.zip" "minecraft generator.exe" >nul
rename "minecraft generator.exe" "potato.exe"
pause
请注意,您使用了mediafire URL而不是实际的文件URL,并且尝试将zip文件下载到.exe。您应该首先以zip格式下载文件,然后使用解压缩来解压缩文件。
另请注意,您的第二个zip似乎受密码保护。