Solved Batch File to remove unwanted folder

FrustratedJP

New member
Local time
8:10 AM
Messages
13
Is there any way to remove all folders from one folder via a batch file?

I've searched for an answer and nothing will work.


Any help would be greatly appreciated. Thank you.
 
Last edited:

My Computer

Computer type
PC/Desktop
OS
Windows 7 Ultimate 64Bit
Welcome to the forum have you just tried rmdir folder /s or deltree c:\ folder
 

My Computer

Computer type
PC/Desktop
OS
win 8 32 bit
Neither of your suggestions worked..
 

My Computer

Computer type
PC/Desktop
OS
Windows 7 Ultimate 64Bit
Not sure what ou are trying to do! When you say remove do you want to delete the sub folders or perhaps move them to another location?
 

My Computer

Computer type
PC/Desktop
OS
Microsoft Windows 7 Home Premium 64-bit 7601 Multiprocessor Free Service Pack 1
CPU
Intel(R) Core(TM) i7-3770 CPU @ 3.40GHz
Motherboard
ASUSTeK COMPUTER INC. P8H77-M
Memory
8.00 GB
Graphics Card(s)
Intel(R) HD Graphics 4000
Sound Card
On Board
Monitor(s) Displays
Dell 24"
Screen Resolution
1920 x 1080
Hard Drives
(1) INTEL SSDSC2CT180A3 ATA Device (2) ST500DM002-1BD142 ATA Device (3) WDC WD3200AAKS-75L9A0 ATA Device (4) Generic- Compact Flash USB Device (5) Generic- MS/MS-Pro USB Device (6) Generic- SD/MMC USB Device (7) Generic- SM/xD-Picture USB
PSU
500w Corsair
Case
Cooler Master
Cooling
3 Fans
Keyboard
Logitech MK300
Mouse
Logitech WOM
Internet Speed
75Mb
Antivirus
Norton 360
Browser
Firefox, Opera, IE
I've downloaded a file, filebot takes that file, renames it then places it in E:\Organized Media. The initial file is saved under E:\Completed, this is the folder & file I would like to delete.

Example: Folder name (X-files bla bla bla) Open folder (X-filesS1E45bla.mkv)
I want to delete both from E:\Completed but every batch file I have found and tried does not work.
 
Last edited:

My Computer

Computer type
PC/Desktop
OS
Windows 7 Ultimate 64Bit
Not sure what ou are trying to do! When you say remove do you want to delete the sub folders or perhaps move them to another location?

Yes, I want to delete all sub folders with E:/Completed.

Every batch file I have found and tried does not work.
 

My Computer

Computer type
PC/Desktop
OS
Windows 7 Ultimate 64Bit
Unless you don't have rights on the folders the cmds I gave you should work
 

My Computer

Computer type
PC/Desktop
OS
win 8 32 bit
I've downloaded a file, filebot takes that file, renames it then places it in E:\Organized Media. The initial file is saved under E:\Completed, this is the folder & file I would like to delete.

Example: Folder name (X-files bla bla bla) Open folder (X-filesS1E45bla.mkv)
I want to delete both from E:\Completed but every batch file I have found and tried does not work.


If the downloaded file create a link /shortcut to another folder, you may not be able to delete.
It will always re-created the same folder E:\Completed if the folder is not found.
That is to say, this E:\Completed will be create on the same root level.

If you look at your 1st statement, E:\Organized Media
And hence it will also created a folder E:\Completed.
Both folders are on the same level E:\
You may have to re-check all the setting of this program as where it will saved to.

For example: Chrome browser.
When on the website, you want to save any webpage /txt files, it auto save to C:\Download
If the C:\Download is not available, it will create the folder C:\Download
If you choose to save the txt file to another location, you input the location folder.
When you exit Chrome browser, and later open the Chrome browser.
Again if you download any txt file, example, it will save to C:\Download and if not available, it will create again.
As you can create another folder for downloading of txt file and must amend the Chrome setting for download to a new C:\NEWfolder

So, you need to check all the setting that will point to this folder E:\Completed.

Normally this will be the temporary folder until completed then move &or copy to the folder.
This is also same for downloading video.
It will create a temp filename while downloading, and will renamed to the original name and the temp filename is thus deleted.

Do note that during downloading &or installing program, the temp file will be in C:\Windows\Temp or C:\Users\your-acct-name\...\Temp folder.
If you know how to access to your temp files at; C:\Users\your-acct-name\AppData\Local\Temp
This is where all temp files are located.
 

My Computer

Computer type
Laptop
Computer Manufacturer/Model Number
Toshiba L630 and L735
OS
Windows 7 x64
Hard Drives
240 GB SSD
The file that downloads is not a link or shortcut, it's an identical file.
 

My Computer

Computer type
PC/Desktop
OS
Windows 7 Ultimate 64Bit
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

Computer type
PC/Desktop
OS
Windows 7 Ultimate 64Bit
************************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

Computer type
PC/Desktop
OS
Windows 7 Ultimate 64Bit
Back
Top