OSD_SetOEMWallpaper
VB Scripting Library > OSD Scripting Library > OSD functions (OSD)
OSD_SetOEMWallpaper()
Section titled “OSD_SetOEMWallpaper()”Sets a custom lock screen or logon background image in the deployed Windows image, depending on the operating system of the image.
Arguments
Section titled “Arguments”No arguments provided.
Return Type
Section titled “Return Type”Boolean, TRUE if function completed successfully.
Wallpaper files
Section titled “Wallpaper files”The wallpaper file to be used must already exist on the disk in the following locations.
| OPERATING SYSTEM | FILE NAME | LOCATION | RESULT |
|---|---|---|---|
| Windows 8, 8.1, 10, 11, Windows Server 2012 / 2012 R2 / 2016 / 2019 / 2022 / 2025 | backgroundDefault.jpg | <target drive>:\Windows\System32\oobe\info\backgrounds\ | The file is set as the lock screen image by policy. Users can’t change the lock screen image. |
| Windows 7, Windows Server 2008 / 2008R2 | backgroundDefault.jpg | <target drive>:\Windows\System32\oobe\info\backgrounds\ | The OEM background is enabled for the logon screen. |
| Windows XP, Windows Server 2003 / 2003R2 | InstallationWallpaper.bmp | <target drive>:\Windows\System32\ | The file is set as the desktop wallpaper of the default user profile. |
The function doesn’t check that the file exists.
Remarks
Section titled “Remarks”Typically used in the PreBootScript.wsf
The wallpaper files can be placed on the filesystem using the OSD extra files feature, which allows for adding aditional files to the filesystem once the image has been applied.
Example
Section titled “Example”The following example specifies that a custom wallpaper should be used.
Private Function IncludeScript(sScriptFile) '...End Function
'Begin bStatus=True If bStatus Then bStatus=IncludeScript("customlib.cis") If bStatus Then bStatus=IncludeLibrary("Capalib.cin") If bStatus Then bStatus=IncludeLibrary("Osdlib.cin") If bStatus Then bStatus=Job_Start("WS","Script Name","1.0","ScriptName.log","INSTALL") If bStatus Then bStatus=OSD_Initialize()
If bStatus Then bStatus=OSD_SetOEMWallpaper()
Job_End(bStatus)'End main