this is the code I use for random wallpapers...

code:
$button1=messagebox("Do you want a random wallpaper?","Random Wallpaper",36,9)
if $button1=6
dim $paper[1]
$rc=SRND(@MSECS)
$count=0
$paperdir=dir("$logon\wallpaper\*.bmp")
while @error=0
REDIM PRESERVE $paper[$count+1]
$paper[$count]=$paperdir
$count=$count+1
$paperdir=dir()
loop
:randpaper
$rnum=rnd($count)
$wallpaper=$paper[$rnum]
$=writevalue("$HKCPCPD","WallpaperStyle","2",REG_SZ)
$=setwallpaper("$logon\wallpaper\$wallpaper")
$button2=messagebox("Do you want to set this as your default wallpaper?","Random Wallpaper",36)
if $button2=6 ;yes
$MyPictures=readvalue("$HKCUSMWCV\Explorer\Shell Folders","My Pictures")
copy "$logon\wallpaper\$wallpaper" "$MyPictures\kixtart.bmp"
$=writevalue("$HKCPCPD","Wallpaper","$MyPictures\kixtart.bmp",REG_SZ)
endif
if $button2=7 ;no
goto randpaper
endif

Adjusted by the long-line police [Big Grin]

[ 07. November 2002, 19:36: Message edited by: Howard Bullock ]
_________________________
How to ask questions the smart way <-----------> Before you ask