The entire thing I'm doing is pretty pointless lol. But I wanted to prank my mother. This is my computer by the way nothing malicious. I just had an idea that the next time she goes to click and open opera I would have a batch files disguised as it instead that would just say some things. Mimic deleting files. Kill exlporer.exe. Change the background to one I created saying something like GOT YA! with a troll face or something. And then either run explorer.exe again or shutdown my laptop. I don't really know what I am doing lol. I have the batch file done but the changing of the desktop has me puzzled. I can have the batch file to replace the current bmp file with one I've made but it doesn't actually change the background. And JFY WPA files just happened to be where I decided to sit the files for this prank at until I'm done with them.
I used this to copy it over.
copy /y "C:\Users\user\Documents\WPA Files\Internet Explorer W
allpaper.bmp" "C:\Users\user\AppData\Roaming\Microsoft\Internet Explorer\Inter
net Explorer Wallpaper.bmp"
I used this to try to get the wallpaper to refresh to show the new one before I found out this doesn't work with windows 8.1
RUNDLL32.EXE user32.dll,UpdatePerUserSystemParameters
I found this but I am not entirely sure what to do with -name or -value or if I need to do anything to them or the others.. Doubt this would even refresh or what ever to make the new wallpaper actually show though.
set-itemproperty -path "HKCU:Control Panel\Desktop" -name wallpaper -value $image
Also found this which I don't get at all..
Add-Type @"
using System;
using System.Runtime.InteropServices;
using Microsoft.Win32;
namespace Wallpaper
{
public enum Style : int
{
Tile, Center, Stretch, NoChange
}
public class Setter {
public const int SetDesktopWallpaper = 20;
public const int UpdateIniFile = 0x01;
public const int SendWinIniChange = 0x02;
[DllImport("user32.dll", SetLastError = true, CharSet = CharSet.Auto)]
private static extern int SystemParametersInfo (int uAction, int uParam, string lpvParam, int fuWinIni);
public static void SetWallpaper ( string path, Wallpaper.Style style ) {
SystemParametersInfo( SetDesktopWallpaper, 0, path, UpdateIniFile | SendWinIniChange );
RegistryKey key = Registry.CurrentUser.OpenSubKey("Control Panel\\Desktop", true);
switch( style )
{
case Style.Stretch :
key.SetValue(@"WallpaperStyle", "2") ;
key.SetValue(@"TileWallpaper", "0") ;
break;
case Style.Center :
key.SetValue(@"WallpaperStyle", "1") ;
key.SetValue(@"TileWallpaper", "0") ;
break;
case Style.Tile :
key.SetValue(@"WallpaperStyle", "1") ;
key.SetValue(@"TileWallpaper", "1") ;
break;
case Style.NoChange :
break;
}
key.Close();
}
}
}
"@
[Wallpaper.Setter]::SetWallpaper( 'C:\Users\user\Documents\WPA Files\Internet Explorer Wallpaper.bmp', 0 )
And this to run the powershell script once I have one lol
PowerShell -NoProfile -ExecutionPolicy Bypass -Command "& {Start-Process PowerShell -ArgumentList '-NoProfile -ExecutionPolicy Bypass -File ""C:\Users\user\Documents\WPA Files\desktopchange.ps1""' -Verb RunAs}"