Page 1 of 1 1
Topic Options
#130526 - 2004-12-02 11:30 PM Script Problems
allenf Offline
Lurker

Registered: 2004-12-02
Posts: 3
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?

Top
#130527 - 2004-12-02 11:35 PM Re: Script Problems
MightyR1 Offline
MM club member
*****

Registered: 1999-09-09
Posts: 1264
Loc: The Netherlands
Howdie Allen,

welcome on board.

To help you could please give us the output from the "$wp" line.

_________________________
Greetz,
Patrick Rutten

- We'll either find a way or make one...
- Knowledge is power; knowing how to find it is more powerful...
- Problems don't exist; they are challenges...

Top
#130528 - 2004-12-03 12:09 AM Re: Script Problems
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11634
Loc: Space
Welcome to the board Allen,

Here is some untested code that should be what you're looking for. You are using the wrong Registry data type in your code for the WriteValue as well.

Code:
Break On

If ExpandEnvironmentVars(ReadValue('HKCU\Software\Microsoft\Internet Explorer\Desktop\General', 'Wallpaper'))= +
'%SystemRoot%\Web\Wallpaper\1024Twheel.jpg'
$WP=WriteValue('HKCU\Software\Microsoft\Internet Explorer\Desktop\General', 'Wallpaper', "", REG_EXPAND_SZ)
EndIf



Top
#130529 - 2004-12-06 03:57 PM Re: Script Problems
allenf Offline
Lurker

Registered: 2004-12-02
Posts: 3
%SystemRoot%\Web\Wallpaper\1024Twheel.jpg
That is the output of $wp

Top
#130530 - 2004-12-06 06:00 PM Re: Script Problems
allenf Offline
Lurker

Registered: 2004-12-02
Posts: 3
this code works better. 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 988 anonymous users online.
Newest Members
JimDunn, fgarcia, Viginette, ManuvdWielNL, Sir_Barrington
17890 Registered Users

Generated in 0.052 seconds in which 0.021 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