Hi I am trying to delete some folders, lots of them, but having some trouble with my script. I welcome some help please, thanks in advance. Here is what I have so far, I am trying to delete all folders with the name Oracle Weblogic that located in c:\programdata\microsoft\windows\start menu\programs folder. I am open to a vb script option as well
SETLOCAL ENABLEDELAYEDEXPANSIONset pgm_folder = "C:\ProgramData\Microsoft\Windows\Start Menu\Programs\"CD "%pgm_folder%"for /d %%a in ("Oracle WebLogic*") do rmdir /s /q %%a
You are not using rm, or wildcards in rmdir, so your reply does not make sense.
Your original code does not work because (a) you add spaces to the var name (!), and (b) have double double quotes.
SETLOCAL ENABLEDELAYEDEXPANSIONpushd C:\ProgramData\Microsoft\Windows\Start Menu\Programs\for /d %%a in ("Oracle WebLogic*") do rmdir /s /q %%apopd
@Bill, all the folders are exactly in "C:\ProgramData\Microsoft\Windows\Start Menu\Programs\". There are a variety of folders that have the word oracle in it, oracle weblogic, orcale weblogic (beahome) oracle common home, oracle application developer to name a few (there are multiple iterations of all the folders). There all located exactly in "C:\ProgramData\Microsoft\Windows\Start Menu\Programs\. My initial approach was to just look for all folders that have oracle in by using oralce*, but there is one folder called Oracle that must not be deleted.
@NewVillageIT (NVIT), my apologies, I did not notice the quotes in your suggestion. I did however apply your code and it worked fine as well.
Is it possible to the leave folder called Orcale, but still delete the other folders named Oracle xxx xxxx without defining each variation?
> Is it possible to the leave folder called Orcale, but still delete the other folders named Oracle xxx xxxx without defining each variation?
Not sure if the question is directed to me. My solution works. I just confirmed. Do you need help with this?
xzay1967
ASKER
@NewVillageIT, the question was not specifically directed to you, but thanks for responding. Bill's final suggestion took care of that option. thanks again.
rmdir /s /q "%%a"