Re: Login Script - log files overwritten
From: Pegasus \(MVP\) (I.can_at_fly.com)
Date: 03/01/04
- Next message: Phil B: "The Computer Browser service depends on the following nonexistent service: n"
- Previous message: Scott Harding - MS MVP: "Re: Sharing permissions"
- In reply to: John: "Login Script - log files overwritten"
- Messages sorted by: [ date ] [ thread ]
Date: Tue, 2 Mar 2004 07:44:39 +1100
"John" <anonymous@discussion.microsoft.com> wrote in message
news:495601c3ff93$7fd88ec0$a401280a@phx.gbl...
> I have a script (cmd file) is being called from the login
> script. If a condition is met the computer name is
> written to a log file housed on a share. Users have
> rights to write to the file but not delete. The problem
> is randomly (once or twice a week) the log file is being
> overwritten. I have seen happen with different script(s)
> and different log files.
>
> An example of the syntax in the script(s) is below:
>
> echo %COMPUTERNAME% >> \\servername\share\logfile
>
> ideas? Two users writing to the file at the same time ?
>
> thanks
>
You are correct: If two users run the script at the same time
then you get a file sharing violation error. To avoid this trap,
code like this:
echo %ComputerName% >> \\ServerName\share\%ComputerName%
You now schedule a task that runs once every night on the server:
@echo off
if not exist \\ServerName\share\collect md \\ServerName\share\collect
for %%a in (\\ServerName\share\*.*) do
type %%a >> \\ServerName\share\collect\collect.txt
del /q \\ServerName\share\collect\*.*
- Next message: Phil B: "The Computer Browser service depends on the following nonexistent service: n"
- Previous message: Scott Harding - MS MVP: "Re: Sharing permissions"
- In reply to: John: "Login Script - log files overwritten"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|