background lockdown

J

Jo

Is there a way to lockdown the users background so that
they can't change it? Or at least change it back to
default if they do change it.
 
G

Guest

-----Original Message-----
Is there a way to lockdown the users background so that
they can't change it? Or at least change it back to
default if they do change it.
.

found the following script on the internet.. Thank Josh.
-----------------------------------------------------------
'~~[author]~~
'Josh Elson
'~~[/author]~~

'~~[emailAddress]~~
'(e-mail address removed)
'~~[/emailAddress]~~

'~~[scriptType]~~
'vbscript
'~~[/scriptType]~~

'~~[subType]~~
'DomainAdministration
'~~[/subType]~~

'~~[keywords]~~
'background picture, wallpaper, picture, registry, regobj,
array, authorized pictures
'~~[/keywords]~~

'~~[comment]~~
'This script will check the current user's background
picture on Windows 2000 or XP and determine if it is in
the array of authorized pictures. If it is not, it will
replace it with a predefined picture. It DOES take a
reboot for this script to take effect. Great for
defeating all of those naughty users that like pictures of
their dogs or that Ferrari Enzo instead of the corporate
standard ;).
'~~[/comment]~~

'~~[script]~~
'==========================================================
================
'
' VBScript Source File -- Created with SAPIEN Technologies
PrimalScript 3.0
'
' NAME: checkssvr.vbs
'
' AUTHOR: Josh Elson, Centura Health
' E-mail: (e-mail address removed)
'
' DATE : 11/11/2003
'
' COMMENT: Checks the background (wallpaper) picture to
see if it is authorized.
' This script will check the current user's
background picture on
' Windows 2000 or XP and determine
if it is in the array of authorized
' pictures. If it is not, it will
replace it with a predefined picture.
' It DOES take a reboot for this
script to take effect. Great for defeating
' all of those naughty users that
like pictures of their dogs or that
' Ferrari Enzo instead of the
corporate standard ;).
'==========================================================
================

Dim WshShell, strCurrBGPIC, arrAuthPics, i
Dim strBGRegKey, objEnv, strWinDir, objFSO,
boolAuthPicFound
Set WshShell = WScript.CreateObject("WScript.Shell")
Set objEnv = WshShell.Environment("Process")
Set objFSO = CreateObject("Scripting.FileSystemObject")

' Set Initial Conditions
boolAuthPicFound = False
strBGRegKey = "HKCU\Control
Panel\Desktop\Wallpaper"

' Find Windows Directory
strWinDir = objEnv("SystemRoot")

' Set Size of Array of Authorized Pictures - make sure
this matches the
' number of actual pics you want in the array - remember
however arrays are 0 based
ReDim arrAuthPics(6)

' Set Default Authorized Picture - will be used if
unauthorized picture is found.
strAuthPic="wpearth.bmp"

' Authorized Picture Filenames go in this array...
arrAuthPics(0)="wpearth.bmp"
arrAuthPics(1)="centura.bmp"
arrAuthPics(2)="wplake.bmp"
arrAuthPics(3)="wpmission.bmp"
arrAuthPics(4)="wpmts.bmp"
arrAuthPics(5)="wpmtlake.bmp"
arrAuthPics(6)="wpflowers.bmp"

' Read current registry key...
strCurrBGPIC = WshShell.RegRead(strBGRegKey)

'WScript.Echo strTrunCurrBGPIC

for i=0 to UBound(arrAuthPics)

If IsInString(strCurrBGPIC, arrAuthPics(i)) Then
'WScript.echo "Picture " & arrAuthPics(i)
& " is Authorized!"
boolAuthPicFound = True

End if

Next

' If we didn't find an authorized pic name in the string,
let's change the BGPIC

If boolAuthPicFound = False Then

If SetBGPic(strWinDir & "\" & strAuthPic)=True Then
' Additional actions go here, if
required....

End If

End If

Set objFSO = Nothing
Set objEnv = Nothing


' **************************
' Functions and Subs
' **************************

' Function to determine if bgpicture is authorized
Function IsInString(MainString, SubString)
IsInString = False

If InStr(MainString, SubString) > 0 Then
IsInString = True
Else
IsInString = False
End If

End Function

' Function to set bgpic
Function SetBGPic(picname)

If objFSO.fileexists(picname) = True then
WshShell.RegWrite strBGRegKey,
picname, "REG_SZ"
SetBGPic = True
Else
SetBGPic = False
End if

End Function
'~~[/script]~~
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top