這裡的代碼:
@echo off
if "%*"=="" (echo Give me the URL! && exit /b)
echo Output :
set /p output=
powershell Invoke-WebRequest -Uri %* -OutFile output
我寫的這段代碼中的問題是輸出變量
如何將該變量發送到 powershell 中?
使用%output%
擴展output
變量-記住引用的論據(否則它會打破,如果有人輸入,空格的路徑):
@echo off
if "%*"=="" (echo Give me the URL! && exit /b)
echo Output :
set /p output=
powershell Invoke-WebRequest -Uri '%*' -OutFile '%output%'
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句