Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <WinAPI.au3>
- #include <WindowsConstants.au3>
- #include <Array.au3>
- Local $a[] = [_WinAPI_GetSystemMetrics($SM_CMONITORS)] _ ; Number of monitors.
- $monitors = _WinAPI_GetSystemMetrics($SM_CMONITORS) ;Save amount of monitors in a Variable
- if $monitors = 1 Then
- RegDelete("Computer\HKEY_CURRENT_USER\Control Panel\Desktop", "WallPaper")
- RegWrite("HKEY_CURRENT_USER\Control Panel\Desktop", "WallPaper", "REG_SZ", "C:\Users\User\Desktop\Files\wallpapers\1mon.jpg")
- Elseif $monitors = 2 Then
- RegDelete("Computer\HKEY_CURRENT_USER\Control Panel\Desktop", "WallPaper")
- RegWrite("HKEY_CURRENT_USER\Control Panel\Desktop", "WallPaper", "REG_SZ", "C:\Users\Kevin\Desktop\Files\wallpapers\2mon.bmp"
- EndIf
- Run("commit.bat") ;This applys the changes I made in RegEdit. Content of this file is in the Post.
- ConsoleWrite("Wallpaper set for " & $monitors & " Monitors")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement