Page 1 of 1 1
Topic Options
#111133 - 2004-01-02 04:09 AM Need a start
olmeca3332003 Offline
Fresh Scripter

Registered: 2003-10-26
Posts: 35
I need to create a file with the logon script that will contain the computer name as the file name and it should append specific information of Avery user that logs on to that computer. I created my first scripWith kixtart, still learning the product. Any idea is welcome, thanks in advance.

Top
#111134 - 2004-01-02 04:56 AM Re: Need a start
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
Code:
Break on

$path='C:\test\'
$rc=RedirectOutput($path+@WKSTA+'.log')
'bla bla bla' ?
$rc=RedirectOutput('')



Edited by Les (2004-01-02 02:45 PM)
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#111135 - 2004-01-02 07:11 AM Re: Need a start
olmeca3332003 Offline
Fresh Scripter

Registered: 2003-10-26
Posts: 35
LES, I appreciate you fast response, here is part of the code. Now I will be working on converting
The files to CSV format or adjust the script to output the desire format, any suggestion?


Break on
$path = "\\Server\share\"
$rc=RedirectOutput($path + @WKSTA + ".log")
? "CompName: " @WKSTA + " User: " @USERID + " Date: " @DATE + " Time: " @TIME + " Location: " $segment + " MAC: " @ADDRESS + " OS: " @PRODUCTTYPE + " SP: " @CSD
$rc=RedirectOutput('@WKSTA.log',0)



Top
#111136 - 2004-01-02 08:35 AM Re: Need a start
pvds Offline
Hey THIS is FUN
*****

Registered: 2001-04-14
Posts: 201
something like this? Code:
 Break on
$path = "\\109837\"
$rc=RedirectOutput($path + @WKSTA + ".log")
? "CompName: " @WKSTA + ", User: " @USERID + ", Date: " @DATE + ", Time: " @TIME + ", Location: " $segment + ", MAC: " @ADDRESS + ", OS: " @PRODUCTTYPE + ", SP: " @CSD
$rc=RedirectOutput('@WKSTA.log',0)



Peter

Top
#111137 - 2004-01-02 10:57 AM Re: Need a start
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11628
Loc: CA
Well depending on what type of data is returned and how you are wanting to review the data you may want to use a different delimiter character. Commas are often contained in the returned data and thus can make a poor delimiter. Opening and importing the file with Excel or Access would render many fields with wrong data.

I use the * as a delimiter myself. So far I have not returned any data that has had this character as part of the returned data.

Top
#111138 - 2004-01-02 02:44 PM Re: Need a start
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
What is the point of this line?
$rc=RedirectOutput('@WKSTA.log',0)

To end redirection, it should be as I showed you.
Also, why do you put the ? at the beginning of the line. It should be at the end like I showed you.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#111139 - 2004-01-02 11:48 PM Re: Need a start
olmeca3332003 Offline
Fresh Scripter

Registered: 2003-10-26
Posts: 35
Thanks All, job well done. Below is the extracted data. I need to put this data in an access table, the words after the asterisk are the headings for the fields in access any suggestions? This is truly a learning experience thanks again.

Data taken from log files:
*CompName: 130BROOK-004 *User: Administrator *Date: 2004/01/02 *Time: 17:08:34 *Location: Texas *MAC: 00104BE2AEFD *OS: Windows 2000 Professional *SP: Service Pack 4

Top
#111140 - 2004-01-03 12:30 AM Re: Need a start
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11628
Loc: CA
Since you want it in ACCESS I would not put in the header/title information as part of the returned data. I would only put in the returned data.

Please review the UDFs and the FAQ section for further information on data manipulations.

At this point if you have the data you can simply open access and import it. If you want to completely automate the process then I think you need to either have someone here write the code for you (Silver Platter Code) or continue to experiment and learn KiXtart.

Silver Platter Code is nice sometimes, but learning why and how it works helps you so that you don't have to ask for help the next time you need this or a similar script.

If you want the code written for you, I guess just ask. Not saying anyone will or will not write it for you but you never know. There is also a search engine on the board to try to find what you're looking for.

Top
#111141 - 2004-01-03 02:46 AM Re: Need a start
olmeca3332003 Offline
Fresh Scripter

Registered: 2003-10-26
Posts: 35
Point well taken, but it will be nice if someone wrote the codes. So happing that I’m one who learns best by
examples. You may have notice that the program's companion text has very little samples.

Top
#111142 - 2004-01-03 03:30 AM Re: Need a start
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
Now, if you would have read ABC's of KiXtart board etiquette and message to new forum users and posted appropriate and sufficient information including your omitted Microsoft Access data import goal, then we could have pointed out that there are numerous database UDFs, e.g. DBCommand() - Executes a SQL statement and returns a recordset if applicable in the UDF Forum. This would enable you to bypass the text files and directly import the into into the database.
_________________________
There are two types of vessels, submarines and targets.

Top
Page 1 of 1 1


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 874 anonymous users online.
Newest Members
StuTheCoder, M_Moore, BeeEm, min_seow, Audio
17884 Registered Users

Generated in 0.1 seconds in which 0.066 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org