Page 1 of 1 1
Topic Options
#114507 - 2004-02-21 12:16 PM Troubles With Messagebox!
msmid Offline
Lurker

Registered: 2004-02-21
Posts: 4
Loc: Leerdam, NL
hi,

I made te folowing script with kix.
Trying to pop up an messagebox.
the mappings are made without a problem but the message box just wont appear!

this is my code trying to display the message box
Code:

;welkoms scherm
;--------------------------------------------
MESSAGEBOX ("$Greeting @Fullname,

Welkom Op het netwerk van: MAAN
De volgende netwerkschijven zijn verbonden:

$DriveI
$DriveJ
$DriveK
$DriveL
$DriveM","Login Script",064,3)



I started the script in my profile path with te folowing:
Code:

kix32.exe login.kix



Within my netlogon directory the folowing files are avalible
Code:

kix32.exe
wkix32.exe
kxrpc.exe
kix32.dll
kx16.dll
kx95.dll



what did I do wrong?
could anywone help me?

thanx a lot!

Maarten Smid (Netherlands)

_________________________
Left Blank To Save Space...

Top
#114508 - 2004-02-21 01:33 PM Re: Troubles With Messagebox!
AndyD Offline
Fresh Scripter
*

Registered: 2001-11-26
Posts: 17
Does the rest of your script work ?

The code you show works OK for me, from a command line.

Is the script actually starting ?

Add some "Beep" lines to get audio feedback that the script is starting OK.
_________________________
AndyD England, UK.

Top
#114509 - 2004-02-21 02:10 PM Re: Troubles With Messagebox!
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
you using win9x?
if not, destroy everything else but the executable (wkix32 or kix32) you are using.

if you really want to know how to make things rock, look at the manual that came with the package for installation instructions.
for more in depth info, check on FAQ forum.
_________________________
!

download KiXnet

Top
#114510 - 2004-02-21 02:14 PM Re: Troubles With Messagebox!
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
oh...
looking your post again, think the first point is to let us or yourself know the OS that is being used as client.
_________________________
!

download KiXnet

Top
#114511 - 2004-02-21 05:13 PM Re: Troubles With Messagebox!
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
Put DEBUG ON into the first line of code, step through it , and see which line fails.
_________________________
There are two types of vessels, submarines and targets.

Top
#114512 - 2004-02-21 05:51 PM Re: Troubles With Messagebox!
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
KXRPC.EXE should not be in the NetLogon share and KIX95.DLL should only be there if the KXRPC service is installed and running. This, BTW, would have no bearing on your problem.

You should clean up your code and stop using vars in strings. I suspect you have a misplaced quote somewhere.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#114513 - 2004-02-21 07:44 PM Re: Troubles With Messagebox!
AndyD Offline
Fresh Scripter
*

Registered: 2001-11-26
Posts: 17
Quote:

You should clean up your code and stop using vars in strings. I suspect you have a misplaced quote somewhere.




Explain please ? Do you mean he shouldn't use the system var @FULLNAME in his string ?
_________________________
AndyD England, UK.

Top
#114514 - 2004-02-21 09:09 PM Re: Troubles With Messagebox!
ShaneEP Moderator Offline
MM club member
*****

Registered: 2002-11-29
Posts: 2127
Loc: Tulsa, OK
That and he shouldnt use...

$DriveI
$DriveJ
$DriveK
$DriveL
$DriveM

In the string

Top
#114515 - 2004-02-21 09:59 PM Re: Troubles With Messagebox!
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11628
Loc: CA
Hello Maarten and welcome to the board.

Please let us know the following information to better help you.

1. What network type do you have NT or AD
2. What client types do you need to support 9x/NT/2K/XP
3. What version of KiXtart are you using

Here is some example code you can try. Copy the following code to a text file then run from a DOS Console KIX32.EXE NEWFILE.KIX and it should operate for you.

I'm not sure what or where you are defining your variables so I created these to demonstrate their operation. If you have real values for them then you can plug those in as well in the real script. For now, just to demonstrate simply run the code as is below.

Code:
Break On
$nul=SetOption('Explicit','On')
$nul=SetOption('NoVarsInStrings','On')
Dim $DriveI,$DriveJ,$DriveK,$DriveL,$DriveM,$WelkomMSG

;welkoms scherm;--------------------------------------------
$DriveI = 'I: '
$DriveJ = 'J: '
$DriveK = 'K: '
$DriveL = 'L: '
$DriveM = 'M: '

$WelkomMSG = 'Greetings ' + @FullName
+ @CRLF + 'Welkom Op het netwerk van: MAAN '
+ @CRLF + 'De volgende netwerkschijven zijn verbonden: '
+ @CRLF + $DriveI
+ @CRLF + $DriveJ
+ @CRLF + $DriveK
+ @CRLF + $DriveL
+ @CRLF + $DriveM
$WelkomMSG = MessageBox($WelkomMSG,'Login Script',64)


Top
#114516 - 2004-02-22 01:48 PM Re: Troubles With Messagebox!
msmid Offline
Lurker

Registered: 2004-02-21
Posts: 4
Loc: Leerdam, NL
1) I'am Using Windows2k Advanced Server with Active Directory installed.
2) I'am using Windows 2k and XP clients (both of them don't popup my message box)
3) My Kixstart version is the latest (downloaded it yesterday) (non beta)

tnx a lot!
_________________________
Left Blank To Save Space...

Top
#114517 - 2004-02-22 02:25 PM Re: Troubles With Messagebox!
Co Offline
MM club member
***

Registered: 2000-11-20
Posts: 1342
Loc: NL
Did you tried NTDOC's script?

Is there an error message when you use DEBUG ON?

_________________________
Co


Top
#114518 - 2004-02-22 02:34 PM Re: Troubles With Messagebox!
msmid Offline
Lurker

Registered: 2004-02-21
Posts: 4
Loc: Leerdam, NL
This is the full version of my script:
Code:

:start
;--------------------------------------------
CLS
Break OFF
Debug ON

;Time equal with server
;--------------------------------------------
SetTime @lserver

;Global Variables
;--------------------------------------------
$hidden="$$"
$ConnectI="NoConnection"
$ConnectJ="NoConnection"
$ConnectK="NoConnection"
$ConnectL="NoConnection"
$ConnectM="NoConnection"
$Greeting="none"

;printer
;--------------------------------------------
AddPrinterConnection("\\wsrv01\MaanDesk")
SetDefaultPrinter("\\wsrv01\MaanDesk")

;HomeDirectory
;--------------------------------------------
use I: /Del
$userdir=\\wsrv01\+@USERID+$hidden
Use I: $userdir

If @error <> 0
Beep
$ConnectI="False"
Sleep 2
Else
$ConnectI="True"
EndIf

;email
;--------------------------------------------
use J: /Del
If InGroup("email")
$emaildir=\\wsrv01\mail_+@USERID+$hidden
Use J: $emaildir
EndIf

If @error <> 0
Beep
$ConnectJ="False"
Sleep 2
Else
$ConnectJ="True"
EndIf

;K - share
;--------------------------------------------
use K: /Del
Use K: "\\wsrv01\Algemeen"

If @error <> 0
Beep
$ConnectK="False"
Sleep 2
Else
$ConnectK="True"
EndIf

;L - Share
;--------------------------------------------
use L: /Del
Use L: "\\lsrv01\apps"

If @error <> 0
Beep
$ConnectL="False"
Sleep 2
Else
$ConnectL="True"
EndIf
;M - Share
;---------------------------------------------
use M: /Del
Use M: "\\lsrv01\mp3"

If @error <> 0
Beep
$ConnectM="False"
Sleep 2
Else
$ConnectM="True"
EndIf

;web
;--------------------------------------------
If InGroup("Web")
Use N: "\\lsrv01\www"
Use O: "\\lsrv01\sql"
EndIf

;Variabelen
;--------------------------------------------
If $ConnectI="True"
$DriveI="- I: Persoonlijke Netwerkschijf"
Else
$DriveI=""
Endif

If $ConnectJ="True"
$DriveJ="- J: Emaildata Netwerkschijf"
Else
$DriveJ=""
Endif

If $ConnectK="True"
$DriveK="- K: Algemene Netwerkschijf"
Else
$DriveK=""

If $ConnectL="True"
$DriveL="- L: Programma's netwerkschijf"
Else
$DriveL=""
Endif
If $ConnectM="True"
$DriveM="- M: Muziek netwerkschijf"
Else
$DriveM=""
Endif

;Moment van de dag
;--------------------------------------------
$hour = val (SubStr(@time,1,2))

Select
Case $Hour < 6
$Greeting = "Goedenacht"
Case $Hour < 12
$Greeting = "Goedemorgen"
Case $Hour < 18
$Greeting = "Goedemiddag"
Case 1
$Greeting = "Goedenavond"
EndSelect

;welkoms scherm
;--------------------------------------------
MESSAGEBOX ("$Greeting @Fullname,

Welkom Op het netwerk van: MAAN
De volgende netwerkschijven zijn verbonden:

$DriveI
$DriveJ
$DriveK
$DriveL
$DriveM","Login Script",064,3)

_________________________
Left Blank To Save Space...

Top
#114519 - 2004-02-22 07:35 PM Re: Troubles With Messagebox!
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
SETTIME should only be used for Windows 9x. It requires at least 'Power User' privileges under Windows NT/2000/XP/2003 and should not be used at all. Instead the Windows Tiem Service sahould be installed, porperly configures, and be used.

Please apply proper quotes around strings, e.g.
Code:

$userdir='\\wsrv01\'+@USERID+'$'


Also, alwasy use
Code:

$rc=setoption('explicit','on')
$rc=setoption('novarsinstrings','on')


in the script header.

See also Why does the console display zeros and ones (amongst others)?
_________________________
There are two types of vessels, submarines and targets.

Top
#114520 - 2004-02-22 08:34 PM Re: Troubles With Messagebox!
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
you have debug on but you don't say what you see there.
_________________________
!

download KiXnet

Top
#114521 - 2004-02-23 08:39 AM Re: Troubles With Messagebox!
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11628
Loc: CA
Here Maarten, give this code a try... You were also missing an ENDIF statement.

Code:
;--------------------------------------------
CLS
; I'd use Break On at least during testing otherwise if you break it will log you off
Break On
Debug ON
Dim $iRC
$iRC=SetOption('Explicit','On')
$iRC=SetOption('NoVarsInStrings','On')
Dim $ConnectI,$ConnectJ,$ConnectK,$ConnectL,$ConnectM,
Dim $Greeting,$userdir,$emaildir
Dim $DriveI,$DriveJ,$DriveK,$DriveL,$DriveM
Dim $Hour,$Msg


;Time equal with server
;--------------------------------------------
SetTime @lserver
? 'Setting Time was: ' + @ERROR + ' ' + @SERROR

;Global Variables
;--------------------------------------------

;Don't need to double up in this case if you use NoVarInStrings option
;$hidden="$$"
$ConnectI="NoConnection"
$ConnectJ="NoConnection"
$ConnectK="NoConnection"
$ConnectL="NoConnection"
$ConnectM="NoConnection"
$Greeting="none"

;printer
;--------------------------------------------
;AddPrinterConnection("\\wsrv01\MaanDesk")
;SetDefaultPrinter("\\wsrv01\MaanDesk")

;HomeDirectory
;--------------------------------------------
use I: /Del
? 'Deleting I: was: ' + @ERROR + ' ' + @SERROR
$userdir='\\wsrv01\'+@USERID+'$'
Use I: $userdir
? 'Mapping I: was: ' + @ERROR + ' ' + @SERROR

If @error <> 0
Beep
$ConnectI="False"
Sleep 2
Else
$ConnectI="True"
EndIf

;email
;--------------------------------------------
; Odd logic here, you unmap the J: drive but only remap if in a group
use J: /Del
? 'Deleting J: was: ' + @ERROR + ' ' + @SERROR
If InGroup("email")
$emaildir='\\wsrv01\mail_' + @USERID + '$'
Use J: $emaildir
? 'Mapping J: was: ' + @ERROR + ' ' + @SERROR
EndIf

If @error <> 0
Beep
$ConnectJ="False"
Sleep 2
Else
$ConnectJ="True"
EndIf

;K - share
;--------------------------------------------
use K: /Del
? 'Deleting K: was: ' + @ERROR + ' ' + @SERROR
Use K: "\\wsrv01\Algemeen"
? 'Mapping K: was: ' + @ERROR + ' ' + @SERROR

If @error <> 0
Beep
$ConnectK="False"
Sleep 2
Else
$ConnectK="True"
EndIf

;L - Share
;--------------------------------------------
use L: /Del
? 'Deleting L: was: ' + @ERROR + ' ' + @SERROR
Use L: "\\lsrv01\apps"
? 'Mapping L: was: ' + @ERROR + ' ' + @SERROR

If @error <> 0
Beep
$ConnectL="False"
Sleep 2
Else
$ConnectL="True"
EndIf
;M - Share
;---------------------------------------------
use M: /Del
? 'Deleting M: was: ' + @ERROR + ' ' + @SERROR
Use M: "\\lsrv01\mp3"
? 'Mapping M: was: ' + @ERROR + ' ' + @SERROR

If @error <> 0
Beep
$ConnectM="False"
Sleep 2
Else
$ConnectM="True"
EndIf

;web
;--------------------------------------------
If InGroup("Web")
Use N: "\\lsrv01\www"
? 'Mapping N: was: ' + @ERROR + ' ' + @SERROR
Use O: "\\lsrv01\sql"
? 'Mapping O: was: ' + @ERROR + ' ' + @SERROR
EndIf

;Variabelen
;--------------------------------------------
;Could also do something like this
;$DriveI=IIf($ConnectI,'- I: Persoonlijke Netwerkschijf',"")

If $ConnectI="True"
$DriveI="- I: Persoonlijke Netwerkschijf"
Else
$DriveI=""
Endif

If $ConnectJ="True"
$DriveJ="- J: Emaildata Netwerkschijf"
Else
$DriveJ=""
Endif

If $ConnectK="True"
$DriveK="- K: Algemene Netwerkschijf"
Else
$DriveK=""
; Was missing an EndIf
EndIf

If $ConnectL="True"
$DriveL="- L: Programma's netwerkschijf"
Else
$DriveL=""
Endif
If $ConnectM="True"
$DriveM="- M: Muziek netwerkschijf"
Else
$DriveM=""
Endif

;Moment van de dag
;--------------------------------------------
$hour = Val(SubStr(@TIME,1,2))
Select
Case $Hour < 6
$Greeting = "Goedenacht"
Case $Hour < 12
$Greeting = "Goedemorgen"
Case $Hour < 18
$Greeting = "Goedemiddag"
Case 1
$Greeting = "Goedenavond"
EndSelect

;welkoms scherm
;--------------------------------------------
;welkoms scherm
;--------------------------------------------
$Msg = ''+$Greeting + @FullName
+'Welkom Op het netwerk van: MAAN'
+'De volgende netwerkschijven zijn verbonden:'
+ @CRLF + $DriveI
+ @CRLF + $DriveJ
+ @CRLF + $DriveK
+ @CRLF + $DriveL
+ @CRLF + $DriveM
; Removed the time out from the MessageBox for testing
$Msg = MessageBox($Msg,'Login Script',64)


Top
#114522 - 2004-02-23 06:53 PM Re: Troubles With Messagebox!
msmid Offline
Lurker

Registered: 2004-02-21
Posts: 4
Loc: Leerdam, NL
tnx for your help but I found the problem!
I just forgotten an end if like the moderator told me
the messagebox now just works perfect

tnx
_________________________
Left Blank To Save Space...

Top
#114523 - 2004-02-23 10:32 PM Re: Troubles With Messagebox!
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11628
Loc: CA
Glad to hear it's working.

You can download a tool from MCA's site that will search for those type of errors for you.

KIXSTRIP

http://home.wanadoo.nl/scripting/

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 1188 anonymous users online.
Newest Members
StuTheCoder, M_Moore, BeeEm, min_seow, Audio
17884 Registered Users

Generated in 0.069 seconds in which 0.025 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