ntlite ps1 script

Pcgamer27

Member
Messages
168
Reaction score
1
I have a question: my ps1 is not running. Does anyone know why this is happening?

Start-Sleep -Seconds 10

# Copy to temp to ensure no spaces or access issues
Copy-Item "$env:USERPROFILE\Documents\Klantentools\pc.jpg" "$env:TEMP\pc.jpg" -Force
$wallpaperPath = "$env:TEMP\pc.jpg"

# Set registry with quotes for paths with spaces
Set-ItemProperty -Path "HKCU:\Control Panel\Desktop" -Name Wallpaper -Value "`"$wallpaperPath`""

Add-Type @'
using System.Runtime.InteropServices;
public class NativeMethods {
[DllImport("user32.dll", SetLastError = true)]
public static extern bool SystemParametersInfo(int uAction, int uParam, string lpvParam, int fuWinIni);
}
'@
[NativeMethods]::SystemParametersInfo(20, 0, $wallpaperPath, 3)

"`n$((Get-Date).ToString()) Wallpaper set to $wallpaperPath" | Out-File -FilePath "$env:USERPROFILE\wallpaperlog.txt" -Append
 
Last edited:
This script does some unnecessary work.

You don't need to copy a file before reading it (you're running as Administrator in order to make a reg update), and the reg update isn't needed when calling the Windows API to change wallpapers.

I would recommend Jose Espitia's 2nd script:
https://www.joseespitia.com/2017/09/15/set-wallpaper-powershell-function/

i have other ps1 script

Set-StrictMode -Version 'latest'
if (Test-Path -Path 'HKCU:\Control Panel\NotifyIconSettings')
{
Get-ChildItem -Path 'HKCU:\Control Panel\NotifyIconSettings' |
ForEach-Object {
Set-ItemProperty -Path ($_.PSPath) -ErrorAction SilentlyContinue -Name 'IsPromoted' -Value 0x00000001
}
}

# Set the taskbar to show the hidden icon arrow thingy (chevron).
New-Item -Path 'Registry::HKCU\SOFTWARE\Classes\Local Settings\Software\Microsoft\Windows\CurrentVersion\TrayNotify' -Force | Out-Null
Set-ItemProperty -Path 'HKCU:\SOFTWARE\Classes\Local Settings\Software\Microsoft\Windows\CurrentVersion\TrayNotify' -Name 'SystemTrayChevronVisibility' -Value 0x1
 
i have other ps1 script
Run this script in Post-Setup (After logon). As I've warned before, this will only display the current apps. If other apps are installed later on, then you will need to re-run the script to unhide them because they didn't exist before.
 
Run this script in Post-Setup (After logon). As I've warned before, this will only display the current apps. If other apps are installed later on, then you will need to re-run the script to unhide them because they didn't exist before.

this sript

# Define source and destination paths (edit as needed)
$sourceFolder = "$env:USERPROFILE\Music\Klantentools" # <-- Change to your actual path
$destinationFolder = "C:\Windows\Media\Sounds"

# Create destination folder if it doesn't exist
if (!(Test-Path -Path $destinationFolder)) {
New-Item -Path $destinationFolder -ItemType Directory -Force
}

# Copy all content, recursive, overwrite existing files
Copy-Item -Path "$sourceFolder\*" -Destination $destinationFolder -Recurse -Force

Write-Host "Sounds copied from $sourceFolder to $destinationFolder"
 
Most install scripts or app installers can be tested on a live system, if you run them as Administrator.

You don't need to run a full install to see if they work. The major difference is (Before logon) works at the SYSTEM level, and cannot reference a local user account's profile, and (After logon) has access to HKCU settings.

So you can test if these scripts work, by yourself. No need to post every one of them.
Unless someone wants to help test them for you.
 
Most install scripts or app installers can be tested on a live system, if you run them as Administrator.

You don't need to run a full install to see if they work. The major difference is (Before logon) works at the SYSTEM level, and cannot reference a local user account's profile, and (After logon) has access to HKCU settings.

So you can test if these scripts work, by yourself. No need to post every one of them.
Unless someone wants to help test them for you.

the scripts work locally but via ntlite it doesn't work that's why I'm posting this
like wallpaper Always show all tray icons
 
Most install scripts or app installers can be tested on a live system, if you run them as Administrator.

You don't need to run a full install to see if they work. The major difference is (Before logon) works at the SYSTEM level, and cannot reference a local user account's profile, and (After logon) has access to HKCU settings.

So you can test if these scripts work, by yourself. No need to post every one of them.
Unless someone wants to help test them for you.

not working wallpaper script


Function Set-WallPaper {

<#

.SYNOPSIS
Applies a specified wallpaper to the current user's desktop

.PARAMETER Image
Provide the exact path to the image

.PARAMETER Style
Provide wallpaper style (Example: Fill, Fit, Stretch, Tile, Center, or Span)

.EXAMPLE
Set-WallPaper -Image "C:\pc.jpg"
Set-WallPaper -Image "C:\Wallpaper\Background.jpg" -Style Fit

#>

param (
[parameter(Mandatory=$True)]
# Provide path to image
[string]$Image,
# Provide wallpaper style that you would like applied
[parameter(Mandatory=$False)]
[ValidateSet('Fill', 'Fit', 'Stretch', 'Tile', 'Center', 'Span')]
[string]$Style
)

$WallpaperStyle = Switch ($Style) {

"Fill" {"10"}
"Fit" {"6"}
"Stretch" {"2"}
"Tile" {"0"}
"Center" {"0"}
"Span" {"22"}

}

If($Style -eq "Tile") {

New-ItemProperty -Path "HKCU:\Control Panel\Desktop" -Name WallpaperStyle -PropertyType String -Value $WallpaperStyle -Force
New-ItemProperty -Path "HKCU:\Control Panel\Desktop" -Name TileWallpaper -PropertyType String -Value 1 -Force

}
Else {

New-ItemProperty -Path "HKCU:\Control Panel\Desktop" -Name WallpaperStyle -PropertyType String -Value $WallpaperStyle -Force
New-ItemProperty -Path "HKCU:\Control Panel\Desktop" -Name TileWallpaper -PropertyType String -Value 0 -Force

}

Add-Type -TypeDefinition @"
using System;
using System.Runtime.InteropServices;

public class Params
{
[DllImport("User32.dll",CharSet=CharSet.Unicode)]
public static extern int SystemParametersInfo (Int32 uAction,
Int32 uParam,
String lpvParam,
Int32 fuWinIni);
}
"@

$SPI_SETDESKWALLPAPER = 0x0014
$UpdateIniFile = 0x01
$SendChangeEvent = 0x02

$fWinIni = $UpdateIniFile -bor $SendChangeEvent

$ret = [Params]::SystemParametersInfo($SPI_SETDESKWALLPAPER, 0, $Image, $fWinIni)
}

Set-WallPaper -Image "C:\Wallpaper\Background.jpg" -Style Fit
 
Most install scripts or app installers can be tested on a live system, if you run them as Administrator.

You don't need to run a full install to see if they work. The major difference is (Before logon) works at the SYSTEM level, and cannot reference a local user account's profile, and (After logon) has access to HKCU settings.

So you can test if these scripts work, by yourself. No need to post every one of them.
Unless someone wants to help test them for you.

I can't seem to get it to change the wallpaper, I've tried several powershell scripts.
 
I've told you before, you can use this raw PNG image. It's over 24 MB. Convert it to JPEG first.
Have you tried using the same scripts on a different image?
 
I've told you before, you can use this raw PNG image. It's over 24 MB. Convert it to JPEG first.
Have you tried using the same scripts on a different image?

this is the wallpaper in jpg and it doesn't work
 

Attachments

  • 1341184-min.jpeg
    1341184-min.jpeg
    2 MB
No problem changing the wallpaper (Post-Setup or directly in the image) as long as the file is in .jpg and the dimension is the same as the default one
 
No problem changing the wallpaper (Post-Setup or directly in the image) as long as the file is in .jpg and the dimension is the same as the default one

so i put wallpaper directly in the post setup like this

This script works, but not via a URL, local image
 

Attachments

  • Screenshot 2025-07-14 at 05.11.23.png
    Screenshot 2025-07-14 at 05.11.23.png
    44.1 KB
  • Screenshot 2025-07-14 at 05.44.06.png
    Screenshot 2025-07-14 at 05.44.06.png
    275.2 KB
Last edited:
Once the ISO/image is mounted, in Windows\Web\Wallpaper\Windows, rename the img0.jpg file to img0_backup.jpg, for example, then copy your wallpaper (.jpg file) and rename it to img0.jpg for the light theme.
For the dark theme, do the same with the img19.jpg file.

PS: Make sure your wallpaper (.jpg file) is the same dimension as the default one.
 
Last edited:
Once the ISO/image is mounted, in Windows\Web\Wallpaper\Windows, rename the img0.jpg file to img0_backup.jpg, for example, then copy your wallpaper (.jpg file) and rename it to img0.jpg for the light theme.
For the dark theme, do the same with the img19.jpg file.

PS: Make sure your wallpaper (.jpg file) is the same dimension as the default one.

I have one image that is used for light and dark theme I have image rename to img0_backup.jpg and put it in post-setup before-login
 

Attachments

  • Screenshot (58).png
    Screenshot (58).png
    370.1 KB
By putting your wallpaper in the Windows\Web\Wallpaper\Windows directory (and same name as the original)
You don't need to use Post-Setup
 
Back
Top