Page 1 of 1 1
Topic Options
#113835 - 2004-02-11 08:33 PM Multiple OS Script not working need help.....
nate Offline
Fresh Scripter

Registered: 2004-02-10
Posts: 7
Here is what I have so far and I only tested on NT 4.0 and Win2K and neither work........

@ECHO
IF NOT "%OS%" == "Windows_NT" GOTO WIN9X
VER|FIND /I "XP" >NUL && IF %ERRORLEVEL% EQU 0 GOTO XP
IF not "%ALLUSERSPROFILE%" == "" GOTO WIN2K
IF "%OS%" == "Windows_NT" GOTO NT4
GOTO END

:XP
ECHO Found Windows XP
REM Or what ever command you want to run.
GOTO END

:WIN2K
ECHO Found Windows 2000
use s: "\\fsga01\administration\it\docs"
GOTO END

:NT4
ECHO Found Windows NT 4
if ingroup("test2")
Use * /delete /Persistent:Yes
shell "SUBST N: /D"
shell "SUBST N: \\fsga01\administration\it"
use m: "\\fsga01\administration"
GOTO END

:WIN9X
ECHO Found Windows 9x
REM Or what ever command you want to run.
GOTO END

:END

Top
#113836 - 2004-02-11 08:37 PM Re: Multiple OS Script not working need help.....
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
You cannot mix batch file syntax and KiXtart syntax!

See the FAQ Forum and the thread "login.bat (overkill)" for example batch files and login scripts.
_________________________
There are two types of vessels, submarines and targets.

Top
#113837 - 2004-02-11 08:41 PM Re: Multiple OS Script not working need help.....
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
indeed this looks like batch which is been tried to enchance with kix.
_________________________
!

download KiXnet

Top
#113838 - 2004-02-11 10:08 PM Re: Multiple OS Script not working need help.....
ShaneEP Moderator Offline
MM club member
*****

Registered: 2002-11-29
Posts: 2127
Loc: Tulsa, OK
Nate...Here is some PURE kix code (not to be mistaken for batch scripting) that does the same thing you were trying to accomplish. You should read the manual that comes with kix to get a handle on how it works.

Code:
Select
Case InStr (@ProductType,"Windows XP")
? "Found Windows XP"
; Or what ever command you want to run.
Case InStr (@ProductType,"Windows 2000")
? "Found Windows 2000"
use s: "\\fsga01\administration\it\docs"
Case InStr (@ProductType,"Windows NT")
? "Found Windows NT 4"
If InGroup ("test2")
Use * /delete /Persistent
shell "SUBST N: /D"
shell "SUBST N: \\fsga01\administration\it"
use m: "\\fsga01\administration"
Endif
Case InStr (@ProductType,"Windows 9")
? "Found Windows 9x"
; Or what ever command you want to run.
Case 1
$null = MessageBox ("Unable To Detect OS...Please Contact A System Administrator","Error",0)
EndSelect


Top
#113839 - 2004-02-12 01:29 AM Re: Multiple OS Script not working need help.....
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
I would even use:
Case 1
$null = MessageBox ("Not Supported OS: "+@producttype+@crlf+"Please Contact your System Administrator","Error",16)
_________________________
!

download KiXnet

Top
#113840 - 2004-02-16 03:26 PM Re: Multiple OS Script not working need help.....
nate Offline
Fresh Scripter

Registered: 2004-02-10
Posts: 7
Thank You very much,the Script work on a 2000 & NT box, still have have to test on XP and Win98.
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.114 seconds in which 0.076 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