Tech Support banner

Status
Not open for further replies.
1 - 7 of 7 Posts

·
Registered
Joined
·
21 Posts
Discussion Starter #1
I need a *.bat file. When launcehd it should delete My Documents folder and close immediatly after that :) I remember smth about deltree <directory> but i won't risk writing it myself :) Please help me!
Oh, did I mention - it should work with WinXP. If not, that's OK too. It should work with win98 then :)
 

·
Citizen of the world
Joined
·
51,041 Posts
Do you really want to delete the actual My Documents folder, or just the contents?

Here's a two line batch job that does it under W98.

DELTREE /Y "C:\My Documents"
EXIT

Note that with XP there is a copy of "My Documents" for each user, so you'd have to specify the complete path to the specific user in question on W2K or WXP. For "Sample User", for instance:

DELTREE /Y "C:\Documents and Settings\Sample User\My Documents"

Of course, you can also right click on "My Documents" and more it anyplace you like, if that has been done, you have to point the batch file to the correct location.

For most command utilities, if you type a /? after the command name, you'll get help. For instance:

c:\>deltree /?
Deletes a directory and all the subdirectories and files in it.

To delete one or more files and directories:
DELTREE [/Y] [drive:]path [[drive:]path[...]]

/Y Suppresses prompting to confirm you want to delete
the subdirectory.
[drive:]path Specifies the name of the directory you want to delete.

Note: Use DELTREE cautiously. Every file and subdirectory within the
specified directory will be deleted.
 

·
TSF Team Emeritus
Joined
·
5,580 Posts
hmm

thats odd, the deltree command doesnt even work on any of the win98 machines i have, and that why i had to peice together a disk with old dos on it to do exactly things like this.

i guess my copies of win98 and 98se are just incomplete.


~BoB~
 

·
Registered
Joined
·
5 Posts
I don't know that you want to delete the My Documents folder but probably just the contents. If that is the case, type the path to the correct My Documents folder and put a "*.*" (without the quotes). Example DELTREE /Y "C:\Documents and Settings\(username)\My Documents\*.*"

This will leave the My Documents folder, it will just delete everything in it. Hope this helps.
 

·
Citizen of the world
Joined
·
51,041 Posts
Re: hmm

bob vila said:
thats odd, the deltree command doesnt even work on any of the win98 machines i have, and that why i had to peice together a disk with old dos on it to do exactly things like this.

i guess my copies of win98 and 98se are just incomplete.

~BoB~
I believe there was a set of "missing DOS files" that Microsoft had on their site years ago, they replaced some of the DOS functions they "forgot" to include for W98. It's been a long time, and I have my collection of DOS boot disks with all the stuff I use on them, but that's my recollection...

Of course, it could also be that the DOS files just aren't in your path, do you have a DOS directory? Is it in your path?
 

·
TSF Team Emeritus
Joined
·
5,580 Posts
well

not to hijack the thread, but when i format and install from my win 98se disk, i do not end up with any type of a dos folder, and the files like deltree, dosshell, doskey, xcopy, etc... arent on my machine at all.

i do have them on a disk though, so its all good.

im just not sure that he has deltree on his machine is why i even mentioned it.

~BoB~
 
1 - 7 of 7 Posts
Status
Not open for further replies.
Top