Differences between revisions 3 and 4
Revision 3 as of 2021-09-08 00:33:08
Size: 1702
Editor: PieterSmit
Comment:
Revision 4 as of 2021-09-08 05:32:22
Size: 2711
Editor: PieterSmit
Comment:
Deletions are marked like this. Additions are marked like this.
Line 21: Line 21:
    == AWS Ec2LaunchSettings ==
 * ```c:\ProgramData\Amazon\EC2-Windows\Launch\Module\Ec2Launch.psm1```
   * this runs all the scripts under EC2-Windows\Launch\Scripts\*.ps1

 * Start > run > !Ec2LaunchSettings
   * {{{ C:\ProgramData\Amazon\EC2-Windows\Launch\Scripts\InitializeInstance.ps1 }}}
     * {{{ Wait-Metadata }}}
     * {{{ New-WallpaperSetup }}}
 * {{{ New-WallpaperSetup.ps1 }}} - in - {{{ c:\ProgramData\Amazon\EC2-Windows\Launch\Module\Scripts\ }}}
   * Create startup dirs for default and all users e.g. "C:\Users\Default\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup"
     * then create "initWallpaperSetupName" as startup script. {{{
#Powershell
"Import-Module "C:\ProgramData\Amazon\EC2-Windows\Launch\Module\Ec2Launch.psd1"; Set-Wallpaper"
# This run's all the ec2 scripts\*.ps1 modules, including "Set-Wallpaper.ps1"
}}}

 * "Set-Wallpaper.ps1"
   * Impost-WallpaperUtil
   * Logs to "WallpaperSetup.log" -> C:\ProgramData\Amazon\EC2-Windows\Launch\Log\


Windows/BackgroundWallpaper

  • 2021 - Win10 - Wallpaper in registry, regedit

    Computer\HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Wallpapers
    • remove BackgroundHistoryPathX to get back windows wallpaper as option.
  • Images in c:\Windows\Web\4K\Wallpaper\Windows\ , c:\Windows\Web\Wallpaper\Windows\img0.jpg

AWS Wallpaper

  • 20 sec after loggin in a user's wallpaper gets updated with server information.
    1. Find user with

      Get-WMIObject -Query "select * from Win32_UserAccount where Name='<username>'"
    2. Reggedit Using the user key e.g.

      Computer\HKEY_USERS\<S-1-5-...62>\Software\Microsoft\Windows\CurrentVersion\Explorer\Wallpapers
    3. This should show the previous and current wall paper e.g.

      BackgroundHistoryPath0  C:\Users\<username>\AppData\Local\Ec2Wallpaper_Info.jpg
      BackgroundHistoryPath1  C:\Windows\web\wallpaper\Windows\img0.jpg

AWS Ec2LaunchSettings

  • c:\ProgramData\Amazon\EC2-Windows\Launch\Module\Ec2Launch.psm1

    • this runs all the scripts under EC2-Windows\Launch\Scripts\*.ps1
  • Start > run > Ec2LaunchSettings

    •  C:\ProgramData\Amazon\EC2-Windows\Launch\Scripts\InitializeInstance.ps1 

      •  Wait-Metadata 

      •  New-WallpaperSetup 

  •  New-WallpaperSetup.ps1  - in -  c:\ProgramData\Amazon\EC2-Windows\Launch\Module\Scripts\ 

    • Create startup dirs for default and all users e.g. "C:\Users\Default\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup"

      • then create "initWallpaperSetupName" as startup script.

        #Powershell
        "Import-Module "C:\ProgramData\Amazon\EC2-Windows\Launch\Module\Ec2Launch.psd1"; Set-Wallpaper"
        # This run's all the ec2 scripts\*.ps1 modules, including "Set-Wallpaper.ps1"
  • "Set-Wallpaper.ps1"

Set for user

* https://superuser.com/questions/430508/how-to-change-desktop-background-of-a-specific-user-in-a-batch-file

#PowerShell:
$user = Get-WMIObject -Query "select * from Win32_UserAccount where Name='<username>'"
$path = 'Registry::HKEY_USERS\' + $user.SID + '\Control Panel\Desktop\'
Set-ItemProperty -path $path -name Wallpaper -value 'C:\path\to\wallpaper.jpg'
rundll32.exe user32.dll UpdatePerUserSystemParameters

Windows/BackgroundWallpaper (last edited 2021-09-08 05:32:22 by PieterSmit)