Page 1 of 1 1
Topic Options
#73434 - 2003-02-25 04:07 PM Checking os before installing
Anonymous
Unregistered


I have my login script checking OS using @PRODUCTTYPE for informational purposes only. Would i would like to do is if the OS is windows 95 or any flavour of server then the command won't run. Otherwise it will run the script, here is the following piece off script. Can any recomend.

Thanks
James

If @PRODUCTTYPE = "windows 95"
endif
else
InGroup ("MIS")
shell "\\dc01\netlogon\vplogon.bat >c:\vplogonerrors.txt"
endif

Top
#73435 - 2003-02-25 04:09 PM Re: Checking os before installing
Rory Daniels Offline
Getting the hang of it

Registered: 2003-02-25
Posts: 64
Loc: Bristol, UK
What type of workstations are you running? Windows NT 4.0, Windows 2000 etc.....
Top
#73436 - 2003-02-25 04:13 PM Re: Checking os before installing
Anonymous
Unregistered


The OS's are windows 95/98/2000/XP and 2000 server. Thanks
Top
#73437 - 2003-02-25 04:14 PM Re: Checking os before installing
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
James,
Do you really need to get that granular. The @InWin macro will paint with a broader brush.

Operating system:
1 = Windows NT/2K/XP
2 = Windows 9x/ME
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#73438 - 2003-02-25 04:17 PM Re: Checking os before installing
Anonymous
Unregistered


Unfortunalty yes, it is a upgrade to norton antivirus corporate edition, windows 95 is no longer support so if a 95 machine runs the script then the user gets a error message box coming up stating that the OS is not supported.

Thanks

Top
#73439 - 2003-02-25 04:30 PM Re: Checking os before installing
Jack Lothian Offline
MM club member
*****

Registered: 1999-10-22
Posts: 1169
Loc: Ottawa,Ontario, Canada
Jens has a function in the UDF library that does this:

Jens Meyer - Provides operating system identifyers

[ 25. February 2003, 16:33: Message edited by: Jack Lothian ]
_________________________
Jack

Top
#73440 - 2003-02-25 04:34 PM Re: Checking os before installing
Anonymous
Unregistered


Can i not use the @producttype as this outputs the OS eg win95, win98 etc

Thanks

Top
#73441 - 2003-02-25 04:37 PM Re: Checking os before installing
Jack Lothian Offline
MM club member
*****

Registered: 1999-10-22
Posts: 1169
Loc: Ottawa,Ontario, Canada
Jens goes to considerable trouble to avoid using this function in his UDF. I would assume it doesn't function properly with Win9x clients.
_________________________
Jack

Top
#73442 - 2003-02-25 05:01 PM Re: Checking os before installing
maciep Offline
Korg Regular
*****

Registered: 2002-06-14
Posts: 947
Loc: Pittsburgh
What about this

code:
  
If @PRODUCTTYPE = "windows 95" or instr(@PRODUCTTYPE, "Server") <> 0
endif
else
InGroup ("MIS")
shell "\\dc01\netlogon\vplogon.bat >c:\vplogonerrors.txt"
endif

_________________________
Eric

Top
#73443 - 2003-02-25 05:17 PM Re: Checking os before installing
Anonymous
Unregistered


The answer by maciep looks like it might work although i get

Error: ELSE without IF!

Any idea's

Thanks

Top
#73444 - 2003-02-25 05:22 PM Re: Checking os before installing
Chris S. Offline
MM club member
*****

Registered: 2002-03-18
Posts: 2368
Loc: Earth
maceip's example has too many endif's in it. Take out the first one.
Top
#73445 - 2003-02-25 05:30 PM Re: Checking os before installing
Chris S. Offline
MM club member
*****

Registered: 2002-03-18
Posts: 2368
Loc: Earth
Don't forget DC's though...

code:
If InStr(@ProductType,"Server") or InStr(@ProductType,"Domain Controler") 
or InStr(@ProductType,"Windows 95")
? "Sorry you cannot install Norton."
Else
? "Installing Norton..."
EndIf


Top
#73446 - 2003-02-25 05:38 PM Re: Checking os before installing
Anonymous
Unregistered


Thanks to everyone who posted help, the problem is now resolved.
Top
#73447 - 2003-02-25 05:50 PM Re: Checking os before installing
maciep Offline
Korg Regular
*****

Registered: 2002-06-14
Posts: 947
Loc: Pittsburgh
Like Chris said, make sure you cover all basis and add as many conditions as you need.

And btw, I just copied the code from the first post and added my condition. So make sure you did get rid of the extra endif.
_________________________
Eric

Top
#73448 - 2003-02-25 06:02 PM Re: Checking os before installing
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
You could for example use the OSID() - Identifies operating system, service pack level, and OS kernel UDF which will give you precise information about different Windows 95 systems and computer roles like workstation, server, domain controller.

And, BTW, I do use this extensively as I heavily rely on the OS Kernel info and server roles in my scripts.

[ 25. February 2003, 18:02: Message edited by: sealeopard ]
_________________________
There are two types of vessels, submarines and targets.

Top
#73449 - 2003-02-26 10:35 AM Re: Checking os before installing
Anonymous
Unregistered


I have found another problem with the script the OS check piece is working if it is win95 or a server it skips install. But once it has confirmed the OS it should confirm the user is in the group if they are not it still installs

Any Idea's

If @PRODUCTTYPE = "windows 95" or instr(@PRODUCTTYPE, "Server") or InStr(@ProductType,"Domain Controler") <> 0
else
InGroup ("MIS")
shell "\\potlldc01\netlogon\vplogon.bat >c:\vplogonerrors.txt"
endif

Top
#73450 - 2003-02-26 04:14 PM Re: Checking os before installing
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
First of all, RTFM for correct syntax!

code:
If @PRODUCTTYPE = 'Windows 95' or instr(@PRODUCTTYPE, 'Server') or InStr(@ProductType,'Domain Controller')
else
IF InGroup ("MIS")
shell '%COMSPEC% /c /e:1024 start /min /wait "\\potlldc01\netlogon\vplogon.bat" >"%TEMP%\vplogonerrors.txt"'
endif
endif

Secondly, please post your code in between [CODE] tags as specified in ABC's of KiXtart board etiquette and message to new forum users

[ 26. February 2003, 16:39: Message edited by: sealeopard ]
_________________________
There are two types of vessels, submarines and targets.

Top
#73451 - 2003-02-26 04:33 PM Re: Checking os before installing
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
Hmmm... might want to run spell checker.

'Domain Controler'
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#73452 - 2003-02-26 04:40 PM Re: Checking os before installing
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
I just copied the original code [Embarrassed]
_________________________
There are two types of vessels, submarines and targets.

Top
#73453 - 2003-02-26 04:55 PM Re: Checking os before installing
Anonymous
Unregistered


I have found the problem and resolved it, I was not reading my own script and missed out the IF statement.

Thanks

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 2220 anonymous users online.
Newest Members
Viginette, ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder
17888 Registered Users

Generated in 0.079 seconds in which 0.036 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