powershell.exe直接运行命令

powershell.exe -Command "& { ('time={0},user={1}' -f (get-date),(whoami)) | Out-File "d:\user.log" -Append }"

 

给.exe文件添加参数,参数是 array 格式

$argus = "$env:windir\", 'c:\jpegs\','*.jpg', '/R:0', '/S', '/XD', '*winsxs*'
Robocopy.exe $argus

posted on 2014-08-28 13:57  momingliu11  阅读(7330)  评论(0编辑  收藏  举报