|
-
September 18th, 2002, 01:55 AM
#1
A Batch File to delete My Documents Content
Hello,
I would like to run a batch file in my Novell 4.11 login scripts to automatically delete all files in the My Documents folder.
What would be the content of the batch file? Would it be something like this?
c:
cd "c:\my documents"
del *.* < "Y" NULL
I was told that I would need two files, one that would contain the del *.* function and another file that contains 'Y' in it (no quotes). This Y would be passed as a parameter to the calling batch file.
I also don't want the command to appear on the screen when run.
I would appreciate any advice.
Thanks,
Andrew
-
September 18th, 2002, 04:56 AM
#2
To stop the script apearing on the screen enter Echo Off.
Del *.* /q will delete without asking for confirmation.
If you think there are sub directories
del *.* /s /q
-
September 18th, 2002, 05:23 AM
#3
In later versions of MS-DOS and in Windows 9x/Me, the following single command will do what you're after:- echo y|del "c:\my documents\*.*">nul
If you wanted to delete everything in "C:\My Documents", including all subdirectories, the command would be:- deltree /y "c:\my documents\">nul
If you wanted the "C:\My Documents" folder itself gone too the command would be:- deltree /y "c:\my documents">nul
If you wanted to see the output from any one of those commands, simply leave off the trailing ">nul" (redirection to NUL).
I highly recommend practicing with an "A:\My Documents" folder, (with subfolders and files in each) first, before using your command on drive "C:".
-
September 18th, 2002, 05:49 PM
#4
Thanks for the replies. I appreciate it. Andrew.
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|