On multiple (about 20) servers, there exists the same directory C:\Deployments. This directory has multiple subfolders which contain more subfolders and files. The C:\Deployments directory itself does not contain files.
I have a batch file that, when run locally, cleans out the C:\Deployments directory. That is, it deletes all subfolders and their files, but doesn't delete the C:\Deployements directory itself.
The batch file code is:
echo off set CAT=c:\deployments dir "%%CAT%%"/s/b/a | sort /r >> %TEMP%\files2del.txt for /f "delims=;" %%D in (%TEMP%\files2del.txt) do (del /q "%%D" & rd "%%D") del /q %TEMP%\files2del.txt
My question is this:
How do I run this batch file on each server from a localized window? That is, how do I run one batch file and have these commands execute on every server simultaneously?
Thanks for any help/ideas!