2011-11-23 37 views

回答

4

將任何%替換爲bat文件中的%%

所以%~nf成爲%%~nf

PowerShell的等價:

gci -r .\test | ?{-not $_.PsIsContainer} | copy-item -Destination .\test2 
+0

謝謝!我怎樣才能改變這些命令來接受起始目錄作爲參數? – user1062718

+0

在PowerShell中?在腳本的頂部使用'param($ source)'並在你想要的地方使用'$ source'。閱讀Powershell參數 – manojlds