Main Site Nav
Topics Topics Edit Profile Profile Help/Instructions Help    
Search Last 1|3|7 Days Search Search Tree View Tree View  

Creating a batch file to delete files

Trish's Escape from Hardware Hell Help Board » Optimizing & Tweaking » Creating a batch file to delete files « Previous Next »

Author Message
Posted on Wednesday, January 14, 2004 - 10:25 pm:   

I have to create a batch file called ex15.bat that will:

1. Update a log file on my C:\root folder and call this file cleanup.log. Each time this batch file is run it should over-write this log file which contains the %USERPROFILE% variable.

2. Merge cleanup.log to the back end of a file called cleanup.hst which is also stored on the C:\root folder.

3. List the directory contents of this TEMP folder.

4. Then ask for permission (using ECHO, REPLY, AND IF ERRORLEVEL'S) to delete all the files from the user's TEMP file.

Can someone please help me, I can't figure out how to do this. The point is to create the batch using the above four steps and each time a user logs on they will execute that batch file automatically and the TEMP files will be deleted.

Thanks a bunch.

Posted on Wednesday, January 14, 2004 - 10:32 pm:   

An operating system would be helpful as batch files can be constructed many different ways for different operating systems.
Posted on Wednesday, January 14, 2004 - 10:58 pm:   

Probably what you are looking for is a way to create logon scripts.

Add Your Message Here
Username: Posting Information:
This is a public posting area. Enter your username and password if you have an account. Otherwise, enter your full name as your username and leave the password blank. Your e-mail address is optional.
Options: Enable HTML code in message
Automatically activate URLs in message

Administration Administration Log Out Log Out   Previous Page Previous Page Next Page Next Page