2011-11-23 91 views

回答

4

将任何%替换为bat文件中的%%

所以%~nf成为%%~nf

PowerShell的等价:

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

谢谢!我怎样才能改变这些命令来接受起始目录作为参数? – user1062718

+0

在PowerShell中?在脚本的顶部使用'param($ source)'并在你想要的地方使用'$ source'。阅读Powershell参数 – manojlds