Go Back   Tech Support Forum > Microsoft Support > Windows XP Support

User Tag List

[SOLVED] Batch file or command to delete folder

This is a discussion on [SOLVED] Batch file or command to delete folder within the Windows XP Support forums, part of the Tech Support Forum category. hello, I was wondering just a few seconds why the subject https://www.techsupportforum.com/foru...er-227649.html had been closed? the problem hasn't been solved?


Closed Thread
 
Thread Tools Search this Thread
Old 11-03-2011, 01:51 PM   #1
Registered Member
 
Join Date: Nov 2011
Posts: 2
OS: xp sp3 and vista sp2 and 7 and ubuntu 10.04 lts


Grin

hello, I was wondering just a few seconds why the subject https://www.techsupportforum.com/foru...er-227649.html had been closed? the problem hasn't been solved?

So I was also wondering how to delete subfolders in batch command line or file?

rezopac is offline  
Sponsored Links
Advertisement
 
Old 11-03-2011, 01:59 PM   #2
Registered Member
 
Join Date: Nov 2011
Posts: 2
OS: xp sp3 and vista sp2 and 7 and ubuntu 10.04 lts



Oh! how stupid am I.

few minutes in google and the answer is :
for example you are dealing with the C:\temp folder and you want to erase all elements in it!
batch file :
@echo off

del "C:\temp\*" /Q /F /S
for /d %%X in ("C:\temp\*") do RMDIR /S /Q %%X

exit

command line for delete subfolders (if you want to test) :
for /d %X in ("C:\temp\*") do RMDIR /S /Q %X

I think it's larger better than erase the "C:\temp" folder and recreate it! Because if you want to do this for all the temporary folders (windows has it tricks)... it will be long. fortunately, you wouldn't do that because I made it for you, enjoy (just replace %profile% by you'r profile name or the profile name variable (%USERNAME%)):


@echo off
del "C:\Documents and Settings\%profile%\Local Settings\Temp\*" /Q /F /S
for /d %%X in ("C:\Documents and Settings\%profile%\Local Settings\Temp\*") do RMDIR /S /Q %%X

del "C:\Documents and Settings\%profile%\Local Settings\Temporary Internet Files\Content.IE5\*" /Q /F /S
for /d %%X in ("C:\Documents and Settings\%profile%\Local Settings\Temporary Internet Files\Content.IE5\*") do RMDIR /S /Q %%X

del "C:\Documents and Settings\%profile%\Local Settings\Application Data\Temp\*" /Q /F /S
for /d %%X in ("C:\Documents and Settings\%profile%\Local Settings\Application Data\Temp\*") do RMDIR /S /Q %%X

del "C:\temp\*" /Q /F /S
for /d %%X in ("C:\temp\*") do RMDIR /S /Q %%X

del "C:\WINDOWS\Temp\*" /Q /F /S
for /d %%X in ("C:\WINDOWS\Temp\*") do RMDIR /S /Q %%X

del "C:\WINDOWS\system32\dllcache\*" /Q /F /S
for /d %%X in ("C:\WINDOWS\system32\dllcache\*") do RMDIR /S /Q %%X

exit

and please, do not close subject with horible things!
rezopac is offline  
Old 11-03-2011, 02:25 PM   #3
TSF Team, Emeritus
 
Join Date: Jun 2010
Location: Saskatchewan, Canada
Posts: 2,619
OS: XP SP3, Windows 7 SP1



The thread was closed because it was created more than 3 years ago and the last post was more than a year ago. It should be closed. When you have a question you should create a new thread as you have done, not add it to an old one. That only causes confusion.

You would use the RMDIR (or RD) command to delete a subfolder. The folder must be empty. However, if you add the /S switch it will delete the subfolder and all folders and files it contains. Use with care. Be aware that files deleted from the command line do not go to the recycle bin.

You can type "help" at the command line to get a list of the most commonly used commands. Type "help commandname" to get more information on a specific command.
LMiller7 is offline  
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Similar Threads
Thread Thread Starter Forum Replies Last Post
Antivirus programs and Windows updates blocked
Hello to the Forum. I have got this problem: it is impossible to update antivirus programs and windows. Regarding the latter, I can't perform windows update neither from the start menu (error code 80072EFE) neither from internet (can't connect to windows update page). Other than this I can't...
beppe1968 Resolved HJT Threads 25 10-06-2011 02:24 AM
Trouble with Directx 10
When trying to install a redist for a game i was going to play, this error comes up: "An internal system error occured. Please refer to DXERROR.log and Directx.log in your Windows folder to determine the problem" This is my DXError.log: -------------------- module: dxupdate(Sep 4 2009),...
xAtlas PC Gaming Support 1 07-29-2011 01:43 PM
My pc is messed up ?
Hi guys.. for sometime now i have been getting error messages, e.g firefox has stopped responding. and every program i use i get this message, explorer.exe has stopped working and then it makes the screen flash. i have also been having bsod problems (ntoskml.exe). i have tryed re-installing windows...
iciboy Motherboards, Bios & CPU 29 04-29-2011 12:38 AM
Not sure what this is so I posted here
Hi all new here but not new to fixing my computer however this last one has me baffled. Usually my Eset Nod32 4.0.467 catches everything. I also have on my computer Spybot, Malware antibytes, Super Antispyware, Ad - Aware, Tune Up Utilities, Registry First Aid 7 Platinum. I have System Mechanic...
toolman_fixit Inactive Malware Help Topics 2 04-03-2011 08:57 PM

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is on
Smilies are on
[IMG] code is on
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


Post a Question


» Site Navigation
 > FAQ
  > 10.0.0.2
Powered by vBadvanced CMPS v3.2.3


All times are GMT -7. The time now is 06:47 PM.


Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2020, vBulletin Solutions, Inc.
vBulletin Security provided by vBSecurity v2.2.2 (Pro) - vBulletin Mods & Addons Copyright © 2020 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.1.0 (Pro) - vBulletin Mods & Addons Copyright © 2020 DragonByte Technologies Ltd.
Copyright 2001 - 2018, Tech Support Forum

Windows 10 - Windows 7 - Windows XP - Windows Vista - Trojan Removal - Spyware Removal - Virus Removal - Networking - Security - Top Web Hosts