Author: rmetzger
Subject: How 2 delete MultipleFolders in 1 PsExec command?
Posted: 20 July 2014 at 11:59pm
Yes, not sure why the quotes were needed in the first place. But if it worked, go for it.
I simply took the alternative batch file example and reduced it down to 1 line. My thought is that if I didn't need them in the multi-line example, the quotes are not needed in the 1 line version.
Note, I added a ~ to the end, to properly unquote any 'quoted' %%D passed to the rd command, given that we are quoting it manually (which would double quote it).
Any way, have fun.
Ron Metzger
Subject: How 2 delete MultipleFolders in 1 PsExec command?
Posted: 20 July 2014 at 11:59pm
![]() Yes, or how about this psexec \\%PC% cmd /c for %%U in (1 2 3 4 5 6 7 8 9 T) do (for /d %%D in ("%USERPROFILE%\..\%%U*.*") do (rd /s /q "%%~D")) Ron Metzger |
![]() You removed the quotes? |
Yes, not sure why the quotes were needed in the first place. But if it worked, go for it.
I simply took the alternative batch file example and reduced it down to 1 line. My thought is that if I didn't need them in the multi-line example, the quotes are not needed in the 1 line version.
Note, I added a ~ to the end, to properly unquote any 'quoted' %%D passed to the rd command, given that we are quoting it manually (which would double quote it).
Any way, have fun.
Ron Metzger