我想知道是否有方法使用.bat文件下載文件。 Bitsadmin.exe不再適用於2008R2。 如果你可以幫助,這將不勝感激。Windows Server 2008 Service Pack 2 - 使用.bat文件下載文件
在此先感謝!
我想知道是否有方法使用.bat文件下載文件。 Bitsadmin.exe不再適用於2008R2。 如果你可以幫助,這將不勝感激。Windows Server 2008 Service Pack 2 - 使用.bat文件下載文件
在此先感謝!
,你可以使用PowerShell像這樣:
(new-object System.Net.WebClient).DownloadFile("http://www.google.co.uk", "c:\temp\tempfile.txt"
有了一個bat文件,調用 PowerShell中,我在senv.bat
做:
@echo off
@powershell -NoProfile -ExecutionPolicy unrestricted -Command "& \"C:\path\to\ascript.ps1\"" %*
然後,script.ps1
可以調用DownloadFile
爲mentioned由Paul。
就在同PowerShell命令實際上可以從普通的shell叫:
C:\> @powershell -NoProfile -ExecutionPolicy unrestricted -Command "(New-Object System.Net.WebClient).DownloadFile('http://an/url','c:/temp/aFile')"
嘿,感謝您的幫助!由於TCADMIN2僅支持該功能,因此我只適用於批處理文件。 – user2954201