Powershell小技巧

1. 在Windows 2008 R2中使用BAT调用Powershell代码,若要使用计划任务自动运行,则Powershell脚本的路径应为绝对路径,如:

powershell.exe E:\360Subway\DelOldFile.ps1

2. Powershell脚本路径中若包含空格,在BAT中调用方式为:

powershell -noexit E:\Test` 2\DelOldFile.ps1
posted @ 2011-05-19 16:16  Xiongpq  阅读(650)  评论(0编辑  收藏  举报