#163298 - 2006-06-15 03:05 PM
If file exists write computer name to text file
|
philp
Lurker
Registered: 2006-06-15
Posts: 4
|
Hi,
I wonder if you could help me with what hopefully will be a simple bit of code. I already have a kixtart script running in net logon and want to query the each PC for a particular file. If it exists I would like to append the computer name to a text file to build a log.
Hopefully all PC's could write to the same log file, prefabaly each computer name on a seperate line. I really only want them to write it once rather than every time the computer logs on.
Any ideas how??
|
|
Top
|
|
|
|
#163300 - 2006-06-15 04:00 PM
Re: If file exists write computer name to text file
|
philp
Lurker
Registered: 2006-06-15
Posts: 4
|
Thanks for the info.
Pinging or querying the individual PC's is not viable as there are 1200+ machines and there is no common time when there are all on. Hence the logon intention.
How about writing a seperate file for each computer (perhaps called the computer name). If the queried file exists the text file is created. Again it would hopefully only attempt to write the text file once - perhaps by checking if a text file already exists for the PC.
Would this work? How would it be coded?
Thanks for the help
|
|
Top
|
|
|
|
#163301 - 2006-06-15 04:27 PM
Re: If file exists write computer name to text file
|
philp
Lurker
Registered: 2006-06-15
Posts: 4
|
As another thought - how complicated would it be to write the computer name to a SQL server database?
|
|
Top
|
|
|
|
#163303 - 2006-06-15 04:44 PM
Re: If file exists write computer name to text file
|
Mart
KiX Supporter
   
Registered: 2002-03-27
Posts: 4673
Loc: The Netherlands
|
|
|
Top
|
|
|
|
#163305 - 2006-06-15 05:05 PM
Re: If file exists write computer name to text file
|
NTDOC
Administrator
   
Registered: 2000-07-28
Posts: 11634
Loc: Space
|
Hmmm... Quote:
Logging to an SQL DB is not that difficult
I'd beg to differ a bit. During logon and all the other tasks happening at the same time and probably well over 100 possible connection error codes for SQL I'm not so sure I'd list it as EASY.
Doable perhaps but with all the normal network connection problems related to simple logon seen around here, I think putting SQL in the mix is a bit more complicated.
|
|
Top
|
|
|
|
#163306 - 2006-06-15 05:33 PM
Re: If file exists write computer name to text file
|
philp
Lurker
Registered: 2006-06-15
Posts: 4
|
Thanks guys - I've kept it simple and gone for the individual file options - works like a charm.
|
|
Top
|
|
|
|
#163308 - 2006-06-15 09:39 PM
Re: If file exists write computer name to text file
|
NTDOC
Administrator
   
Registered: 2000-07-28
Posts: 11634
Loc: Space
|
No, not knocking SQL just the word EASY 
Does take a bit more work to setup and manage then a text file, but beyond that SQL is much more versatile for massaging the data.
|
|
Top
|
|
|
|
Moderator: Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart
|
0 registered
and 2220 anonymous users online.
|
|
|