I am having problems with this code in a script:

$wp=READVALUE("HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Desktop\General", "Wallpaper")
"$wp"
if $wp = "%SystemRoot%\Web\Wallpaper\1024Twheel.jpg"
$rc=WriteValue("HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Desktop\General", "Wallpaper","","REG_SZ")
endif

When it gets to the if statements it doesn't run the writevalue command. What am I doing wrong?