2014-01-31 36 views

回答

1

,你可以使用PowerShell像這樣:

(new-object System.Net.WebClient).DownloadFile("http://www.google.co.uk", "c:\temp\tempfile.txt"

+0

嘿,感謝您的幫助!由於TCADMIN2僅支持該功能,因此我只適用於批處理文件。 – user2954201

1

有了一個bat文件,調用 PowerShell中,我在senv.bat做:

@echo off 

@powershell -NoProfile -ExecutionPolicy unrestricted -Command "& \"C:\path\to\ascript.ps1\"" %* 

然後,script.ps1可以調用DownloadFilementionedPaul

就在同PowerShell命令實際上可以從普通的shell叫:

C:\> @powershell -NoProfile -ExecutionPolicy unrestricted -Command "(New-Object System.Net.WebClient).DownloadFile('http://an/url','c:/temp/aFile')" 
相關問題