as title says, it it possible delete a whole load of files/folders that have different names using just parts of the each file/folder name? like a bunch of language files with same begining name but a different end name for each one? like if i wanted to remove all files/folders with "_ar-sa_" in winsxs? amd64_microsoft.windows.c..-controls.resources_6595b64144ccf1df_5.82.14393.0_ar-sa_c2bd6350b3617a2c just working on a winsxs cleapup project but need an easier way to remove the files/folders when a new version is installled. does this make sense and is it possible?
Normally the 'Wildcard' sign is the * (Star) and not _ (underline)! Maybe that could work! Just take a lot of Caution if you try that, it's totally on your own risk!!
ok, will test before trying for real tried it but it didn't work "The filename, directory name, or volume label syntax is incorrect." any idea why? anyone got a working solution?
for /f "tokens=* delims= " %a in ('dir/b/ad ^| find "_ar-sa_"') do (rd /s /q %a) is working but doesn't work in a batch file, any ideas? nvm, all sorted now.
Sorry about previous post, i mixed dir with rd batch need double %% for variables Code: for /f "tokens=* delims=" %%a in ('dir /b /ad *ar-sa*') do (rd /s /q %%a)
You first search for all files containing the common part or string of characters in their name. This will give you a list containing them. If that list seems OK to you, you then select them all and delete them simultaneously. This way you can also check what you are about to delete and exclude anything you want to keep.