Batch File to remove unwanted folder

Page 2 of 2 FirstFirst 12

  1. Posts : 13
    Windows 7 Ultimate 64Bit
    Thread Starter
       #11

    The file that downloads is not a link or shortcut, it's an identical file.
      My Computer


  2. Posts : 13
    Windows 7 Ultimate 64Bit
    Thread Starter
       #12

    Ok, tell me this, I created a batch file. Here it is:
    Forfiles -p "E:\Completed" -s -m *.* /C "cmd /c del @path"

    I placed a txt, MP4, MP3, avi, mkv & mov file in the "E:/Completed" folder, initiated the batch file and it removed ALL files.
    I then placed the same files in E:/Completed/TEST. Initiated the batch file, it deleted ALL files in "TEST" folder but left the "TEST" folder.

    All I would like the batch file to do is to remove ALL folders and files.
      My Computer


  3. Posts : 13
    Windows 7 Ultimate 64Bit
    Thread Starter
       #13

    ************************FYI**********************

    If anyone is looking to delete every single file and subfolder in a directory,
    but not the directory itself, here is the batch file to do so.

    FOR /D %%p IN ("E:\Completed\*.*") DO rmdir "%%p" /s /q

    Your welcome :)
      My Computer


 
Page 2 of 2 FirstFirst 12

  Related Discussions
Our Sites
Site Links
About Us
Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 10:12.
Find Us