Help me i can't remove a full directory in win 2K dos-box.

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I can't find a command to remove a directory in dos cause microsoft does not support the deltree command in win 2000. Someone please help me cause the script i need it for is due today

thanx!!

Joy
 
Jay said:
I can't find a command to remove a directory in dos cause microsoft does not support the deltree command in win 2000. Someone please help me cause the script i need it for is due today.


thanx!!!

Joy

RD or RMDIR
 
This only works if the directory is empty and i need it in a script to remove the local userprofiles of students who have logged on to the machine. Cause else it eats up all the space on the hard-drive. I work for a school and on an average day there are 50 logins on every computer. So after 1 week the computer totally freezes up.

Thx anyway!!!!

Joy
 
Jay said:
This only works if the directory is empty and i need it in a script to remove the local userprofiles of students who have logged
on to the machine. Cause else it eats up all the space on the hard-drive. I work for a school and on an average day there are 50
logins on every computer. So after 1 week the computer totally freezes up.
Thx anyway!!!!

DEL /?

Pick your switches then

RD /S

Rick
 
Jay said:
This only works if the directory is empty and i need it in a script to
remove the local userprofiles of students who have logged on to the machine.
Cause else it eats up all the space on the hard-drive. I work for a school
and on an average day there are 50 logins on every computer. So after 1 week
the computer totally freezes up.
Thx anyway!!!!

Joy

Not quite. When you come across a new command, like the one that Phil gave
you, then you should
start a Command Prompt so that you can explore its properties. You will soon
see that there are some very useful switches:

C:\TEMP>rd /?
Removes (deletes) a directory.

RMDIR [/S] [/Q] [drive:]path
RD [/S] [/Q] [drive:]path

/S Removes all directories and files in the specified directory
in addition to the directory itself. Used to remove a directory
tree.

/Q Quiet mode, do not ask if ok to remove a directory tree with /S
 
So far so good but the usage of wildcards is not allowed in this statement and i have to remove the local profiles from the machines but the trick is i only want to remove the students profiles not the administrator ans all users ones
eg: c:\docs & settings\4444
here the directory 44444 is the userid of the student and if i type
rd /q docs & settings he will trow the profile of administrator away. I just want him to remove all numerical directories in the parent directory

Thanx for the help you have been great allready!!!!!!

Joy
 
Jay said:
So far so good but the usage of wildcards is not allowed in this statement
and i have to remove the local profiles from the machines but the trick is i
only want to remove the students profiles not the administrator ans all
users ones.
eg: c:\docs & settings\44444
here the directory 44444 is the userid of the student and if i type
rd /q docs & settings he will trow the profile of administrator away. I
just want him to remove all numerical directories in the parent directory!
Thanx for the help you have been great allready!!!!!!!

Joy

You can certainly use wildcards, with some small modification:

for /d %a in ("c:\documents and settings\4*.*") do rd /s /q "%a"

or inside a batch file:

@echo off
for /d %%a in ("c:\documents and settings\4*.*") do rd /s /q "%%a"

The trick in these posts is to formulate your question as precisely as you
can. If you had written "What command do I use in a script file to remove
all folders that start with "4" in 'c:\documents and settings'?" then Phil
Robyn would have given you a comprehensive answer in his first reply. You
haven't seen Phil in action - I have!
 
Back
Top