Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.
Deleting subfolders /batch
Name: Dosnotes Date: June 11, 2009 at 22:37:15 Pacific OS: Windows XP Subcategory: Batch
Comment:
Im trying to delete the contents of the e:\test folder using the command:
echo y | del e:\test\ /s
via a batch file, though it doesnt delete the subfolders, only the files. Anyone know how to amend the syntax to do this or if theres another way to do this?
The following statement deletes all subfolders in E:\test
for /D %%j in (E:\test) do RD /S /Q "%%j"
0
Response Number 2
Name: Dosnotes Date: June 14, 2009 at 20:21:08 Pacific
Reply:
Ive tried the command ;
for /D %%j in (E:\test) do RD /S /Q "%%j"
from the prompt in dos though receive the error;
"%%j was unexpected at this time." Is %%J a referance or am I missing something.
0
Response Number 3
Name: Judago Date: June 15, 2009 at 00:33:16 Pacific
Reply:
If you use for loops from the command line only one percent % sign is used for for loop variables, inside batch scripts two %% are used. Use %j instead of %%j.
Summary: I am new to VBS and was wondering how you would write a script that would delete subfolders of subfolders found in a directory.... the delete would need to be by part of the name as well as the date c...
Summary: This is an example of a batch file I am using right now. I need it to delete subfolders in the folders. It already deletes everything else, just not folders. I am not sure what extra code lines I n...
Summary: I am new to scripting and I am trying to do the following but I am getting a bit lost. I'm sure the solution is quite simple! I want to delete a number of subfolders in a folder, but not all of them. ...