(Msg. 1) Posted: Thu Aug 21, 2008 10:46 pm
Post subject: Delete A Log File After Printing Access Denied Archived from groups: microsoft>public>win2000>file_system (more info?)
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.
(Msg. 2) Posted: Fri Aug 22, 2008 3:12 am
Post subject: Re: Delete A Log File After Printing Access Denied [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
"Delta_X" <Delta_X.RemoveThis@discussions.microsoft.com> wrote in message
news:3D6A7343-EE05-4A90-A80F-7AC9A9ABD5B2@microsoft.com...
> 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.
All times are: Eastern Time (US & Canada) (change)
Page 1 of 1
You can post new topics in this forum You can reply to topics in this forum You can edit your posts in this forum You can delete your posts in this forum You can vote in polls in this forum