#!/usr/bin/perl use strict; use warnings; # Use the Windows Registry Win32::Registry; # Dir of all useable Wallpapapers my $base_dir = 'C:\Dokumente und Einstellungen\Ricco\Lokale Einstellungen\Anwendungsdaten\Microsoft\Wallpaper\\'; # get the actual Wallpaper from Registry my $filename=$HKEY_CURRENT_USER->Open('Control Panel\Desktop')->GetValue('Wallpaper'); # Get all wallpapers in dir my @files=sort glob("${base_dir}*.*"); # find next wallpaper my $pos=0; # last if the actual walpaper is found in list while($pos<@files) { last if ($filename eq $files[$pos]); $pos++; } # at end of list begin at start. $pos=-1 if($pos>=$#files) # get the next wallpaper in list $pos++; $filename=$files[$pos]; # set the path in registry my $type=$HKEY_CURRENT_USER->Open('Control Panel\Desktop')->GetType('Wallpaper'); my $filename=$HKEY_CURRENT_USER->Open('Control Panel\Desktop')->SetValue('Wallpaper',$type,$filename);