Page 1 of 1 1
Topic Options
#135220 - 2005-03-10 11:12 AM error logging?
jifop Offline
Fresh Scripter

Registered: 2004-12-21
Posts: 17
Loc: England
hi guys, i use this script to find out the ip address of a computer and map drive accordingly.
however occasionally it doesnt map the drives. can i get kix to output errors to a log file so that on the occasions when a user reports incorrect mapping i can try to figure out why?

Thanks in advance

"BREAK ON
$1st=TRIM(SPLIT(@IPADDRESS0,'.')[0])
$2nd=TRIM(SPLIT(@IPADDRESS0,'.')[1])
$3rd=TRIM(SPLIT(@IPADDRESS0,'.')[2])
$4th=TRIM(SPLIT(@IPADDRESS0,'.')[3])


IF $3rd = 0
?"Adding Borehamwood Drive Mappings..."
use G: '\\millen\g_drive'
use H: '\\millen\_root'
use P: '\\millen\@USERID'
Exit
Endif

IF $3rd = 1
?"Adding Alconbury Drive Mappings..."
use G: '\\cerberus\g_drive'
use P: '\\cerberus\users\@USERID'
?
IF @INWIN = 1 ADDPRINTERCONNECTION ("\\titania\hp2300n") = 0
IF @INWIN = 1 ADDPRINTERCONNECTION ("\\titania\hp2300n (2)") = 0
? "Adding printers..."
Endif
cls
Exit
Endif
"

Top
#135221 - 2005-03-10 11:51 AM Re: error logging?
Co Offline
MM club member
***

Registered: 2000-11-20
Posts: 1342
Loc: NL
You can use the following commands to create a logfile:

@error, @serror; for errors
Open, writeline, close ; to create a logfile
or Redirectoutput

_________________________
Co


Top
#135222 - 2005-03-10 12:58 PM Re: error logging?
Co Offline
MM club member
***

Registered: 2000-11-20
Posts: 1342
Loc: NL
Also, there are some UDFs you can use:

Log(): Log string to file or console

DisplayText() - Display text incl. logging option

OpenFile() - Open the specified file with options.

WriteLog() - Generic logging facility for scripts

WriteLog2() - Writes to a specified log file with optional TimeStamp
_________________________
Co


Top
#135223 - 2005-03-10 01:21 PM Re: error logging?
jifop Offline
Fresh Scripter

Registered: 2004-12-21
Posts: 17
Loc: England
ok where do i put that in the script? also i can t seem to get the syntax right it doesnt work

@error, @serverr;
Open '\\server\folder\file.log', writeline, close ;

?

Top
#135224 - 2005-03-10 02:28 PM Re: error logging?
Howard Bullock Offline
KiX Supporter
*****

Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
You will need to to read the manual on how to use the OPEN, WRITELINE, and CLOSE commands. Or read the FAQ on how to use UDFs and use one of the pre-written logging functions from the list of links provided in this thread.


Searching on Mapdrive will give you many hits, but this link has an example of what you want...
http://www.kixtart.org/ubbthreads/showflat.php?Cat=&Board=UBB1&Number=129914
_________________________
Home page: http://www.kixhelp.com/hb/

Top
#135225 - 2005-03-11 01:07 AM Re: error logging?
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
And see the fAQ forum for threadsa dealing with TCP/IP, it'll give you some UDFs that can be used for subnet matching.
_________________________
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 2220 anonymous users online.
Newest Members
Viginette, ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder
17888 Registered Users

Generated in 0.168 seconds in which 0.14 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