我想这很容易,但我有一个运行中的Powershell脚本,我希望将其作为Windows 10中的计划任务运行,但是该脚本不能从任务调度程序执行。
脚本为hider.ps1
$fs = New-Object -ComObject scripting.filesystemobject
Get-ChildItem "D:\TV Shows\" -force | Where-Object {$_.psiscontainer} | ForEach-Object {
if($fs.getfolder($_.fullname).size -lt 20mb) {$_.attributes = "directory,hidden"}
else{$_.attributes = "directory"}
}这会隐藏目录中的空文件夹
在Task scheduler中,我将
启动一个程序Powershell
参数-ExecutionPolicy Bypass –File "F:\Xaved Files\Hider ps 1"
发布于 2015-09-02 18:40:18
https://stackoverflow.com/questions/31764168
复制相似问题