#39785 - 2003-05-01 11:33 PM
Re: Writing to a CSV file
|
NTDOC
Administrator
   
Registered: 2000-07-28
Posts: 11628
Loc: CA
|
Boy, I'm glad I don't work where you guys are. Way too many LOOPS/WAITS/SLEEPS/etc...
Do your people ever get to logon?
Howard already told you how to do it, and you guys seemed to have ignored his suggestion.
Basically you write a log file for each computer, then you copy that data into a single file and import with Excel.
Here is a basic idea (code has not been tested)
$AuditFile=("s:\Logs\"+@WKSTA+".LOG") IF EXIST ($AuditFile) DEL ($AuditFile) ENDIF $IEVersion = ReadValue("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer","Version") $Freespace = GetDiskSpace("C:\") /1024 IF OPEN(1,$AuditFile, 5)= 0 $out = WriteLine(1, "@DATE+"*"+@TIME+"*"+@WKSTA+"*"+@USERID+"*"+@FULLNAME+"*"+$FREESPACE+"*"+@PRODUCTTYPE+"*"+@CSD+"*"+$IEVERSION+"*"+@CRLF") $x = CLOSE(1) ENDIF
Then from your workstation in a batch file you run
@ECHO OFF COPY s:\Logs\*.LOG C:\REPORTS\INVENTORY.TXT
Then you run Excel and you open C:\REPORTS\INVENTORY.TXT and you remove all delimiters and add the * as the delimiter I don't use the , as I find that too often it is used in names or other areas that will screw up your import to Excel. Have not found very many applications or names that use the * so that is why I use it. Now you should have a very nice list of Systems and their data.
And no file locking/waiting to deal with.
|
|
Top
|
|
|
|
Moderator: Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart
|
0 registered
and 837 anonymous users online.
|
|
|