Page 1 of 1 1
Topic Options
#53546 - 2001-01-31 09:57 PM Win98 machines exit script!
brewdude6 Offline
Hey THIS is FUN

Registered: 2000-10-21
Posts: 280
Loc: Nashville, TN
Somebody please help me out before I go POSTAL! I can run this script on Win95 machines, Win2k, and AS machines. When a 98 machine runs it it acts as if it's a server...it exits the script. Can somebody help a poor old network guy out? Here is a section of the script. It bombs at the bottom when it checks to see if it's a server.

code:

select
Case @inwin=1
$kernel="WinNT"
$Svcpack=ReadValue("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion","CSDVersion")
$prodkey="HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\ProductOptions"
$type=ReadValue("$prodkey","ProductType")
$Suite=ReadValue("$prodkey","ProductSuite")
IF LEN($Suite)>0
while INSTR($Suite,"|")
$pipe=INSTR($Suite,"|")
$front=SUBSTR($Suite,1,$pipe-1)
$back =SUBSTR($Suite,$pipe+1,len($suite)-len(front) )
$Suite=$front+" "+$back
loop
Else
$Suite=""
EndIf
select
Case @dos=5.0
$system="Win2k"
Case @dos=4.0
$system="WinNT"
endselect
select
Case $type="LANMANNT"
$flavor="$Suite"+"Domain Controller"
Case $type="ServerNT"
$flavor="$Suite "+"Member Server"
Case $type="WinNT"
$flavor="Workstation"

endselect
Case @inwin=2
$kernel="Win9x"
$Svcpack=""
$SubVer=ReadValue("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion","SubVersionNumber")
select
Case @dos="4.90"
$system="WinME"
$flavor="A"
Case @dos="4.10"
$system="Win98"
select
Case $subver="a " ;This is the culprit, needs a space before the "a".
$flavor="SE"
Case $subver=" "
$flavor="A"
endselect
Case @dos="4.0"
$system="Win95"
select
Case $subver=" C"
$flavor="OSR2.5"
Case $subver=" B"
$flavor="OSR2"
Case $subver="a"
$flavor="A"
endselect
endselect
endselect

? "Kernel is $kernel"
? "OS is $system $Svcpack"
? "Flavor is $flavor"

select

case $flavor="$Suite"+"Domain Controller" or $flavor="$Suite"+"Member Server"
gosub "end"
endselect


[This message has been edited by brewdude6 (edited 31 January 2001).]

[This message has been edited by brewdude6 (edited 02 February 2001).]

[This message has been edited by brewdude6 (edited 02 February 2001).]

_________________________
I could have made a neat retort but didn't, for I was flurried and didn't think of it till I was downstairs.
-Mark Twain

Top
#53547 - 2001-01-31 09:59 PM Re: Win98 machines exit script!
brewdude6 Offline
Hey THIS is FUN

Registered: 2000-10-21
Posts: 280
Loc: Nashville, TN
hmmmm...I hosed the formatting on that. I'm sure you can still read it. Sorry.
_________________________
I could have made a neat retort but didn't, for I was flurried and didn't think of it till I was downstairs.
-Mark Twain

Top
#53548 - 2001-01-31 10:02 PM Re: Win98 machines exit script!
cj Offline
MM club member
*****

Registered: 2000-04-06
Posts: 1102
Loc: Brisbane, Australia
dude,

[/code], not [\code] - you can edit this bit of post and all the formatting will return.

cj

P.S.
[kix]
; WebKix version 1.0
; by cj
$message="[This message has been edited by cj (edited 31 January 2001).]"
at(8,0) "$message"
quit
[/kix]

[This message has been edited by cj (edited 31 January 2001).]

Top
#53549 - 2001-01-31 10:24 PM Re: Win98 machines exit script!
brewdude6 Offline
Hey THIS is FUN

Registered: 2000-10-21
Posts: 280
Loc: Nashville, TN
thanks cj
_________________________
I could have made a neat retort but didn't, for I was flurried and didn't think of it till I was downstairs.
-Mark Twain

Top
#53550 - 2001-01-31 11:02 PM Re: Win98 machines exit script!
MyITGuy Offline
Fresh Scripter

Registered: 2001-01-30
Posts: 11
Does it fail? It seems that it would at the line stating:

gosub "end"

Is there a label defined for "end"?

Or am I just missing that peice of code?

_________________________
Automating your life to make my life easier.

Top
#53551 - 2001-01-31 11:25 PM Re: Win98 machines exit script!
brewdude6 Offline
Hey THIS is FUN

Registered: 2000-10-21
Posts: 280
Loc: Nashville, TN
I didn't paste that part of the code but there is a sub string there with "exit" immediately following it.

code:

:end
exit


[This message has been edited by brewdude6 (edited 01 February 2001).]

[This message has been edited by brewdude6 (edited 01 February 2001).]

_________________________
I could have made a neat retort but didn't, for I was flurried and didn't think of it till I was downstairs.
-Mark Twain

Top
#53552 - 2001-01-31 11:45 PM Re: Win98 machines exit script!
DrillSergeant Offline
MM club member
*****

Registered: 2004-07-09
Posts: 1164
Loc: Eijsden, the Netherlands
if you start the script with the switch /d like this:

Kix32 script.kix /d

you are prompted for every line.

If you type the name of a variable (after it is defined in the script), the value will be returned to you.

You could pinpoint the error a bit better with this (I hope )

------------------
Greetz,

Roger the Young
------------------------
The code is out there...
------------------------

http://home.wanadoo.nl/r.s.m.s.dejong/Kixtart

------------------------

_________________________
The Code is out there

Top
#53553 - 2001-02-01 02:00 AM Re: Win98 machines exit script!
brewdude6 Offline
Hey THIS is FUN

Registered: 2000-10-21
Posts: 280
Loc: Nashville, TN
I suppose I should be more detailed. I did use the debug switch...it fails on 98 machines at the last statement in the snipet of code that I posted. It for some reason believes it is a DC.

[This message has been edited by brewdude6 (edited 01 February 2001).]

_________________________
I could have made a neat retort but didn't, for I was flurried and didn't think of it till I was downstairs.
-Mark Twain

Top
#53554 - 2001-02-02 10:26 AM Re: Win98 machines exit script!
Anonymous
Unregistered


I've just run your script fragment on a Win98SE machine and the output is interesting, to say the least. Have a look at the flavor line.

Kernel is Win9x
OS is Win98
Flavor is $flavor

Oh, the script did also bomb out with the machine being identified, incorrectly, as a server.

Ok, here's the cause:
The subversion for 98SE is " A " (<space>A<space> ). Change that and the script works as expected. Better yet, fill in the $subver variable with a default string at the head of the script to ensure it is never empty when you get to the bottom, which is the real reason the script failed.

Top
#53555 - 2001-02-03 12:27 AM Re: Win98 machines exit script!
brewdude6 Offline
Hey THIS is FUN

Registered: 2000-10-21
Posts: 280
Loc: Nashville, TN
I am learning more and more about Kix every day. Thank you so much Fuse.
_________________________
I could have made a neat retort but didn't, for I was flurried and didn't think of it till I was downstairs.
-Mark Twain

Top
#53556 - 2001-02-02 03:07 PM Re: Win98 machines exit script!
brewdude6 Offline
Hey THIS is FUN

Registered: 2000-10-21
Posts: 280
Loc: Nashville, TN
Ok...I pinpointed the problem thanks to Fuse. There is a space missing in the "SE" section of the code I posted. I edited the code and put a note in there. Thanks to everyone!
_________________________
I could have made a neat retort but didn't, for I was flurried and didn't think of it till I was downstairs.
-Mark Twain

Top
Page 1 of 1 1


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

Who's Online
0 registered and 1045 anonymous users online.
Newest Members
ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder, M_Moore
17887 Registered Users

Generated in 0.052 seconds in which 0.031 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