#53546 - 2001-01-31 09:57 PM
Win98 machines exit script!
|
brewdude6
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
|
|
|
|
#53550 - 2001-01-31 11:02 PM
Re: Win98 machines exit script!
|
MyITGuy
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
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
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
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
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
|
|
|
|
Moderator: Glenn Barnas, NTDOC, Arend_, Jochen, Radimus, Allen, ShaneEP, Ruud van Velsen, Mart
|
0 registered
and 931 anonymous users online.
|
|
|