Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Deleting folders with spaces in name using "for do"

I am using the following to clear my favorites folder:

for /d %%X in (C:UsersMeFavorites*) do rmdir /s /q %%X

Unfortunately this does not remove folders with spaces in the name:
i.e. "Microsoft Websites" etc

How to write above code to remove folder names with spaces?


Comments

  • rushenttrushentt Member Posts: 33
    Which version of VB or you using ?

    Rgds

    Terry

    : I am using the following to clear my favorites folder:
    :
    : for /d %%X in (C:UsersMeFavorites*) do rmdir /s /q %%X
    :
    : Unfortunately this does not remove folders with spaces in the name:
    : i.e. "Microsoft Websites" etc
    :
    : How to write above code to remove folder names with spaces?
    :
    :
    :
  • maggotmaggot Member Posts: 2
    Its ok Terry I have solved it.
    I needed to put "" round %%X

    for /d %%X in (C:UsersMeFavorites*) do rmdir /s /q "%%X"

    M

    : Which version of VB or you using ?
    :
    : Rgds
    :
    : Terry
    :
    : : I am using the following to clear my favorites folder:
    : :
    : : for /d %%X in (C:UsersMeFavorites*) do rmdir /s /q %%X
    : :
    : : Unfortunately this does not remove folders with spaces in the name:
    : : i.e. "Microsoft Websites" etc
    : :
    : : How to write above code to remove folder names with spaces?
    : :
    : :
    : :
    :

Sign In or Register to comment.