1. 在Windows 2008 R2中使用BAT调用Powershell代码,若要使用计划任务自动运行,则Powershell脚本的路径应为绝对路径,如:
powershell.exe E:\360Subway\DelOldFile.ps1
2. Powershell脚本路径中若包含空格,在BAT中调用方式为:
powershell -noexit E:\Test` 2\DelOldFile.ps1
1. 在Windows 2008 R2中使用BAT调用Powershell代码,若要使用计划任务自动运行,则Powershell脚本的路径应为绝对路径,如:
powershell.exe E:\360Subway\DelOldFile.ps1
2. Powershell脚本路径中若包含空格,在BAT中调用方式为:
powershell -noexit E:\Test` 2\DelOldFile.ps1
相关文章: