PC Review


Reply
Thread Tools Rate Thread

Delete A Log File After Printing Access Denied

 
 
Delta_X
Guest
Posts: n/a
 
      22nd Aug 2008
I'm writing a batch file that will print out a 3 log files, copy them to a
removable disk and then delete them to start the log file over. The only
thing is the files are being written to so it won't let them be deleted using
DEL. I need to clear the files after printing and copying so only that days
activity is printed and copied to the removable disk. Any ideas how I can
clear the contents of the old file to start new for the next day? Or if I
used MOVE instead of COPY, would that work because the file is open for
writing?
If this is in the wrong spot please direct me to where I should put it.
 
Reply With Quote
 
 
 
 
Pegasus \(MVP\)
Guest
Posts: n/a
 
      22nd Aug 2008

"Delta_X" <(E-Mail Removed)> wrote in message
news:3D6A7343-EE05-4A90-A80F-(E-Mail Removed)...
> I'm writing a batch file that will print out a 3 log files, copy them to a
> removable disk and then delete them to start the log file over. The only
> thing is the files are being written to so it won't let them be deleted
> using
> DEL. I need to clear the files after printing and copying so only that
> days
> activity is printed and copied to the removable disk. Any ideas how I can
> clear the contents of the old file to start new for the next day? Or if I
> used MOVE instead of COPY, would that work because the file is open for
> writing?
> If this is in the wrong spot please direct me to where I should put it.


You need to follow this sequence:
1. Stop the process that writes to the log file.
2. Print the file.
3. Delete the file.
4. Restart the process.


 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Access denied when trying to delete a file Nathan Sokalski Windows XP Performance 4 27th Feb 2005 10:10 AM
Access denied when trying to delete a file Nathan Sokalski Windows XP Security 4 27th Feb 2005 10:10 AM
Access denied when trying to delete a file Nathan Sokalski Windows XP General 4 27th Feb 2005 10:10 AM
How do I delete a file that says access denied and won't let me de =?Utf-8?B?UGV0ZXI=?= Windows XP Help 1 21st Aug 2004 08:46 PM
cannot delete file: access denied Karthik Windows XP General 7 19th Oct 2003 02:44 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:43 PM.