I want to make a new variable in windows. The variable is the path to the All Users Profile. %allusersprofile%
Since this path dont exist anywhere in the registry, i use the 'common desktop' key and strip i the '\desktop'. I could not find a way in kix to do this the easy way, so here is the result:

$x = ReadValue("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders", "Common Desktop")
$d = "Desktop"
if instr("$x", "$d")
$sl = len("$d") + 1
endif
$d = "Skrivebord"
if instr("$x", "$d")
$sl = len("$d") + 1
endif
$kl = len("$x")
$y = $kl - $sl
$AllUsersProfile = substr("$x", 1, $y)
setm "AllUsersProfile=$AllUsersProfile"

Any comments, suggestions, questions?

------------------
Magne