Quantcast
Channel: The Official Scripting Guys Forum! forum
Viewing all articles
Browse latest Browse all 15028

run dos command on file in all subfolder of "test"

$
0
0

I have written a script to capture all files within the folder, but how do I run a program with dos command for only files in the folder and it subfolder?

$files = get-childitem c:\test -recurse

foreach($file in $files){

$filesCounts = $files.Count

if(!$filesCounts)

{

$filesCount = 1

}

$intNumberfiles++

& "C:\program files (x86)\program\program.exe" -password KIVnow C:\test\.\$file

}


Viewing all articles
Browse latest Browse all 15028

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>