Page 1 of 2 12>
Topic Options
#44336 - 2003-08-21 10:12 AM w2k service pack key?
Stephen Wintle Offline
Seasoned Scripter

Registered: 2001-04-10
Posts: 444
Loc: England
Ive had a look through the registry but cant seem to find a key that shows which service pack the machine is currently using, I want to use this info to update the service pack intalled, does anyone know the registry key that shows this?

Steve.
_________________________
Dont worry because a rival imitates you. As long as they follow in your tracks they cant pass you!

Top
#44337 - 2003-08-21 10:47 AM Re: w2k service pack key?
AzzerShaw Offline
Seasoned Scripter
****

Registered: 2003-02-20
Posts: 510
Loc: Cheltenham, England
Sure its :

HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion","CSDVersion")
_________________________
If at first you don't succeed, try again. Then quit. There's no use being a damn fool about it. - W.C Fields

Top
#44338 - 2003-08-22 12:45 AM Re: w2k service pack key?
Stephen Wintle Offline
Seasoned Scripter

Registered: 2001-04-10
Posts: 444
Loc: England
Thanks for you reply have tried the following
code:
 ;--------------------------------Installs W2k service pack automatically-----------------------------------
If @inwin = "1"

$srvpk="HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion"
If (ReadValue($srvpk, "CDSVersion", "Service Pack 4", "REG_SZ") <> 0)
RUN "G:\W2KSRVPK4\W2KSP4_EN.EXE -u -q -z"
Endif

Endif

With the following error:
,= Step Into, = Step Over, "\"= Command, = Go, = Quit
If (ReadValue($srvpk, "CDSVersion", "Service Pack", "REG_SZ") <> 0)

C:\>cd ..
Invalid directory

C:\>cd\

C:\>cd winnt

C:\WINNT>kix32 /d c:\winnt\hiddrv1.kix
Script error: invalid method/function call: too many parameters!
If (ReadValue($srvpk, "CDSVersion", "Service Pack", "REG_SZ") <> 0)

C:\WINNT>

Having read the manual it seems I cant use the function in this way.

[ 21. August 2003, 12:48: Message edited by: Stephen Wintle ]
_________________________
Dont worry because a rival imitates you. As long as they follow in your tracks they cant pass you!

Top
#44339 - 2003-08-22 12:51 AM Re: w2k service pack key?
Co Offline
MM club member
***

Registered: 2000-11-20
Posts: 1342
Loc: NL
@CSD

See the Kix manual.. [Big Grin]
_________________________
Co


Top
#44340 - 2003-08-22 12:56 AM Re: w2k service pack key?
AzzerShaw Offline
Seasoned Scripter
****

Registered: 2003-02-20
Posts: 510
Loc: Cheltenham, England
Try this mate

code:
 
If @inwin= "1"
$os_service = ReadValue("$Compname\HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion","CSDVersion")
If $os_service = "Service Pack 3" OR If $os_service = "Service Pack 2" OR If $os_service = "Service Pack 1"
Run "G:\W2KSRVPK4\W2KSP4_EN.EXE -u -q -z"
EndIf
EndIf

let us know if it works

Aaron
_________________________
If at first you don't succeed, try again. Then quit. There's no use being a damn fool about it. - W.C Fields

Top
#44341 - 2003-08-21 01:05 PM Re: w2k service pack key?
AzzerShaw Offline
Seasoned Scripter
****

Registered: 2003-02-20
Posts: 510
Loc: Cheltenham, England
Actually that wont work - try this...

code:
  

If @inwin= "1"
$os_service = ReadValue("$Compname\HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion","CSDVersion")
If $os_service = "Service Pack 3" OR $os_service = "Service Pack 2" OR $os_service = "Service Pack 1"
Run "G:\W2KSRVPK4\W2KSP4_EN.EXE -u -q -z"
EndIf
EndIf


_________________________
If at first you don't succeed, try again. Then quit. There's no use being a damn fool about it. - W.C Fields

Top
#44342 - 2003-08-21 01:55 PM Re: w2k service pack key?
Co Offline
MM club member
***

Registered: 2000-11-20
Posts: 1342
Loc: NL
Try this..

code:
If @dos = "5.0"
If @csd<>"Service Pack 4"
Run "G:\W2KSRVPK4\W2KSP4_EN.EXE -u -q -z"
EndIf
EndIf

_________________________
Co


Top
#44343 - 2003-08-21 02:16 PM Re: w2k service pack key?
Radimus Moderator Offline
Moderator
*****

Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
if split(@producttype)[1]='2000' and split(@csd)[2]<'4'
copy '\\server\win2ksp4\w2ksp4_EN.exe' 'c:\'
md '%windir%\sp4'
shell 'c:\w2ksp4_EN.exe /U /X:%windir%\sp4'
sleep 2
del 'c:\w2ksp4_EN.exe'
run '%windir%\sp4\i386\update\update.exe /u /N /F '
quit
endif
_________________________
How to ask questions the smart way <-----------> Before you ask

Top
#44344 - 2003-08-21 02:34 PM Re: w2k service pack key?
Stephen Wintle Offline
Seasoned Scripter

Registered: 2001-04-10
Posts: 444
Loc: England
Thanks for your reply, however none of my w2k clients have any service pack installed, this means that using the CSDVersion wont work because the key dosnt exsist.

Radimus I see your version copies the file onto the c: root then creates a dir copies the file into here and then deletes from c: and runs the new copy. Why not make the directory and then copy into this?

I like the idea of the script as it means changing one value once the inevitable service pack 5 arrives.

Steve.
_________________________
Dont worry because a rival imitates you. As long as they follow in your tracks they cant pass you!

Top
#44345 - 2003-08-21 02:38 PM Re: w2k service pack key?
Radimus Moderator Offline
Moderator
*****

Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
split(@csd)[2] will return 0 if no SP is installed

copy the exe to the client conserves bandwidth and server time... and is MUCH faster

extracting the files to the client into a folder allows the machine access to the SP files if something needs to reinstall something from the SP
_________________________
How to ask questions the smart way <-----------> Before you ask

Top
#44346 - 2003-08-21 05:52 PM Re: w2k service pack key?
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
And please search the KiXtart BBS as service pack update scrips have been already discussed numerous times.

And always give a KiXtart function/command/macro a try before thinking it won't work. If a service pack is not installed, @CSD will still return a meaningful value.
_________________________
There are two types of vessels, submarines and targets.

Top
#44347 - 2003-08-21 11:55 PM Re: w2k service pack key?
JohnQ Offline
Starting to like KiXtart

Registered: 2003-03-04
Posts: 171
Radimus, Do you really think it is beneficial to copy the SP locally and then run the install?

I did some tests (nothing in great detail) with XPsp1 and 2Ksp3 and found that uncompressing the service pack to a directory on a server and then running update.exe from the client machine and letting the client pull what it needed was consistantly faster than copying the entire SP locally and then executing.

Just curious to hear your thoughts.

Top
#44348 - 2003-08-21 11:59 PM Re: w2k service pack key?
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
I think the main reason is that you can install the SP without user needed.

it can be ran at anytime and without users even seeing it execute.
but that requires it to be on local machine.

anyway, you can unpack the package and remove many unneeded stuff and repack it to make it faster.
remember that there is a lot of "shit" in there.
_________________________
!

download KiXnet

Top
#44349 - 2003-08-22 12:00 AM Re: w2k service pack key?
Radimus Moderator Offline
Moderator
*****

Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
I think so... especially when having lots of clients hit the SP install at once.

copy 1 large compressed file to the client vs. serving hundreds of expanded files

less traffic on the server, and the client does the install faster with all files local.

if space is an issue, you may want to use server based files, but newer machines have nothing but extra space...
_________________________
How to ask questions the smart way <-----------> Before you ask

Top
#44350 - 2003-08-22 12:40 AM Re: w2k service pack key?
JohnQ Offline
Starting to like KiXtart

Registered: 2003-03-04
Posts: 171
Lonkero, I never thought about removing stuff and then repackaging. Is it simple to repackage? How can you be certain that you're not eliminating something that might cause the install to fail?
Top
#44351 - 2003-08-22 08:12 AM Re: w2k service pack key?
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
well, good example is taiwan language support that comes with SP.
now, do you need it?
this type of simple things are easy to rip of.
in office setup you can remove the whole IE folder etc...

the repackaging can be avoided by opening the file with winrar or similar archiver and removing the unneeded.
thus you don't need to worry about anything [Big Grin]

sure, you should try it before deploying to 1732 clients.

again, it might not be as simple as I said.
[Big Grin]
have to leave you something to think.

anyway, extract the SP, check what you don't want in there.
then create a self-executing archive with winrar or similar.

thus, the speed is also better as the file-integrity check can be this way avoided.
_________________________
!

download KiXnet

Top
#44352 - 2003-08-22 01:21 PM Re: w2k service pack key?
Stephen Wintle Offline
Seasoned Scripter

Registered: 2001-04-10
Posts: 444
Loc: England
Thanks for your comments, I guess it makes more sense to run the thing from the client side especially as I work in a school and you can have 30 users logging on at the same time..

I have the following error when running your script Radimus:
,= Step Into, = Step Over, "\"= Command, = Go, = Quit
if split(@producttype)[1]='2000' and split(@csd)[2]<'4'

C:\>cd winnt

C:\WINNT>kix32.exe /d hiddrv1.kix
Script error: Error in expression: this type of array not supported in expressio
ns.!
copy 'G:\w2ksp4\w2ksp4_EN.exe' 'c:\'

C:\WINNT>

Regards

Steve.
_________________________
Dont worry because a rival imitates you. As long as they follow in your tracks they cant pass you!

Top
#44353 - 2003-08-22 01:52 PM Re: w2k service pack key?
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
stephen, what is that step into stuff?

also, what is your kixtart version?
this code will not work for all.
as far as I remember, non working version is 4.10 or 4.11

also, could you use at least wkix32 4.20 when you run the code so we can see the actual error it gives.
_________________________
!

download KiXnet

Top
#44354 - 2003-08-22 02:38 PM Re: w2k service pack key?
Kdyer Offline
KiX Supporter
*****

Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
Really it should be 4.21..

As there were a number of issues addressed with COPY/MOVE/DEL from 4.20, that is recursively.

Kent
_________________________
Utilize these resources:
UDFs (Full List)
KiXtart FAQ & How to's

Top
#44355 - 2003-08-22 03:19 PM Re: w2k service pack key?
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
nah, don't care about the issues [Wink]
I wish to get proper error report and wki32.exe 4.20 should do it fine [Razz]
_________________________
!

download KiXnet

Top
Page 1 of 2 12>


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

Who's Online
0 registered and 1003 anonymous users online.
Newest Members
StuTheCoder, M_Moore, BeeEm, min_seow, Audio
17884 Registered Users

Generated in 0.075 seconds in which 0.029 seconds were spent on a total of 13 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org