Page 1 of 1 1
Topic Options
#33678 - 2002-11-28 03:11 PM WriteProfileString
BrianK Offline
Getting the hang of it

Registered: 2002-10-02
Posts: 90
Loc: Amsterdam, The Netherlands
I'm having some trouble with a piece of script I made. I'm running Kix 4.12 on a XP client. The objective is that a local version.ini is crosschecked with a server version, for update purposes.
code:
 
If Exist ("C:\Program Files\Network Associates\VirusScan\version.ini")
;Version.ini is in place
Else
$file = "c:\Program files\Network Associates\VirusScan\version.ini"
$rc=WriteProfileString($file, "Config", "Version", 0)
EndIf
$availvers =readprofilestring("s:\stahlapps\vscan\config.451\version.ini","Config","Version")
$currvers =readprofilestring("c:\program files\network associates\virusscan\version.ini","Config","Version")
If $availvers > $currvers
; Shell "c:\program files\network associates\virusscan\msi_inst.exe /import s:\stahlapps\vscan\config.451\Stahl-XP.ini /restart"
$rc=WriteProfileString($file, "Config", "Version",$availvers)
? "This is the available version: " + "$availvers"
EndIf

Everything works fine, only the second writeprofilestring line doesn't work. The version.ini is not updated.
The testline however is working fine and shows the correct available version.

Please advise.

Thanks in advance.

Brian
_________________________
Rodney Dangerfield: “My mother didn't breast-feed me. She said she liked me as a friend.”

Top
#33679 - 2002-11-28 03:15 PM Re: WriteProfileString
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
yes yes...
you don't initialize the $file at all if the version ini is in place.

so, you should remove the $file="blaa" line to the top of the script to make it worky.
_________________________
!

download KiXnet

Top
#33680 - 2002-11-28 03:22 PM Re: WriteProfileString
BrianK Offline
Getting the hang of it

Registered: 2002-10-02
Posts: 90
Loc: Amsterdam, The Netherlands
Damn Lonkero... again you're right [Smile]

Thanks, brian
_________________________
Rodney Dangerfield: “My mother didn't breast-feed me. She said she liked me as a friend.”

Top
#33681 - 2002-11-28 03:24 PM Re: WriteProfileString
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
yes, yes [Wink]
_________________________
!

download KiXnet

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

Generated in 0.059 seconds in which 0.029 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