powershell - how to find all .bat files and execute them one by one? -


i still new powershell , need help.

i have .bat files in folder called: c:\scripts\run\ , want run them 1 one don't know how many have, changes time time.

so want run loop foreach this:

foreach ($file in get-childitem c:\scripts\run | {$_.extension -eq ".bat"}) 

but don't know how run them now. know can run them 1 1 :

./run1.bat ./run2.bat ./run3.bat 

but how implement that? thanks!!

try this:

get-childitem -path c:\scripts\run -filter *.bat | % {& $_.fullname} 

Comments

Popular posts from this blog

c++ - Creating new partition disk winapi -

Android Prevent Bluetooth Pairing Dialog -

VBA function to include CDATA -