cd "D:\symantec\scan engine\cmdlinescanner\" write-host "start scanning for a file that starts with a!" Get-childitem -path z:\ | where {$_. name -match "^a"} | select fullname | out-file files.txt # Get files and folders starting with a, output to A.txt file $file = get-content "files.txt" #将files .txt content to $file$file -replace "(? m) \s", "" > files.txt #删除a spaces in a. txt file $file = get-content "Files.txt" $file = $file [3: $file. count] | out-file files.txt # Delete the first three lines of the file description information, the content of the output overwrites the contents of the A.txt file $file = get-content "Files.txt" foreach ($check in $file) { $check = "" $check "" " #给轮循的内容加上双引号 cmd /c ssecls.exe -server 127.0.0.1:1344 -mode scan -recurse -api 1 -exclude exclude.lst -log a%date%.log $check >> a%date%-result.log write-host $check "}write-host " scan completed with a head-up file! "
This article is from the "BOM water Year _" blog, please be sure to keep this source http://timefiles.blog.51cto.com/8475652/1855343
Powershell traverses a folder under a disk