Cambiar wallapaper

08/09/2004 - 01:59 por Jesús Gutierrez | Informe spam
Hola !!1

Tengo un Domain controller con windows 2000 y clientes XP,, hay forma de
cambiar el wallpaper para los usuarios al momento de firmarse??

the usado este sccript para clientes 2000 y funciona muy bien pero no lo
hace para XP

alguna idea??

Hi!!

Is there a way to change the windows xp wallpaper when a user logs on??

I have used the following script in windows 2000 and works fine however it
does not work in Windows XP

any Ideas???

Is there any other way to do that??
I hava a DC running windows 2000 AS and all the clientes are XP

thanx =)

Option Explicit
Dim CompleteImagesFolderPath
Dim ImageFileTypes
CompleteImagesFolderPath = \\path
ImageFileTypes = "jpg"
Dim WshShell
Set WshShell = Wscript.CreateObject("Wscript.Shell")
Dim ImageFiles
Dim Final
Dim strDesktop

Set ImageFiles = CreateObject("Scripting.Dictionary")
strDesktop = WSHShell.SpecialFolders("Desktop")

call RandomImage(CompleteImagesFolderPath,ImageFileTypes)


Function RandomImage(CompleteImagesFolderPath, ImageFileTypes)

'Declare variables
Dim FileSystemObject
Dim ImageFolder
Dim Files
Dim i
Dim File
Dim FileName
Dim FileExtension
Dim RandomNumber

Set FileSystemObject = CreateObject("Scripting.FileSystemObject")

If Not FileSystemObject.FolderExists(CompleteImagesFolderPath) Then
RandomImage = "Error 0: Cannot find requested folder"
Set FileSystemObject = nothing
Exit Function
End If

Set ImageFolder = FileSystemObject.GetFolder(CompleteImagesFolderPath)

Set Files = ImageFolder.Files

i = 1


For Each File in Files

FileName = File.Name
FileExtension = Right(FileName, Len(FileName) - (InStrRev(FileName, ".")))

If InStr(1,ImageFileTypes,FileExtension,vbTextCompare) > 0 then
ImageFiles.Add i, FileName
i = i + 1
End If

Next

Set ImageFolder = nothing
Set Files = nothing
Set FileSystemObject = nothing

Randomize

If ImageFiles.Count = 0 Then
RandomImage = "Error 1: Folder no existe"
Exit Function
End If

RandomNumber = Int((ImageFiles.Count) * Rnd + 1)
Final = CompleteImagesFolderPath&"\"&ImageFiles.Item(RandomNumber)

WshShell.RegWrite "HKEY_CURRENT_USER\Software\Microsoft\Internet
Explorer\Desktop\General\Wallpaper",Final,"REG_SZ"
WshShell.RegWrite "HKEY_CURRENT_USER\Control
Panel\Desktop\Wallpaper",Final,"REG_SZ"


'CompleteImagesFolderPath&"\"&ImageFiles.Item(RandomNumber)
Set ImageFiles = nothing


WSHShell.AppActivate strDesktop
WSHShell.SendKeys "{F5}"

End Function
 

Leer las respuestas

#1 Marc [MVP Windows]
08/09/2004 - 11:38 | Informe spam
Qué servidor de DNS tienen los XP? Por otro lado, las plantillas del DC están actualizadas para XP?


Saludos

Marc
MCP - MVP Windows Shell/User
Oracle9i Certified Associate (OCA)
NOTA. Por favor, las preguntas y comentarios en los grupos, así nos beneficiamos todos.

Reglas de conducta de los grupos de noticias: http://support.microsoft.com/defaul...newsreglas

"Jesús Gutierrez" wrote in message news:
Hola !!1

Tengo un Domain controller con windows 2000 y clientes XP,, hay forma de
cambiar el wallpaper para los usuarios al momento de firmarse??

the usado este sccript para clientes 2000 y funciona muy bien pero no lo
hace para XP

alguna idea??

Hi!!

Is there a way to change the windows xp wallpaper when a user logs on??

I have used the following script in windows 2000 and works fine however it
does not work in Windows XP

any Ideas???

Is there any other way to do that??
I hava a DC running windows 2000 AS and all the clientes are XP

thanx =)

Option Explicit
Dim CompleteImagesFolderPath
Dim ImageFileTypes
CompleteImagesFolderPath = \\path
ImageFileTypes = "jpg"
Dim WshShell
Set WshShell = Wscript.CreateObject("Wscript.Shell")
Dim ImageFiles
Dim Final
Dim strDesktop

Set ImageFiles = CreateObject("Scripting.Dictionary")
strDesktop = WSHShell.SpecialFolders("Desktop")

call RandomImage(CompleteImagesFolderPath,ImageFileTypes)


Function RandomImage(CompleteImagesFolderPath, ImageFileTypes)

'Declare variables
Dim FileSystemObject
Dim ImageFolder
Dim Files
Dim i
Dim File
Dim FileName
Dim FileExtension
Dim RandomNumber

Set FileSystemObject = CreateObject("Scripting.FileSystemObject")

If Not FileSystemObject.FolderExists(CompleteImagesFolderPath) Then
RandomImage = "Error 0: Cannot find requested folder"
Set FileSystemObject = nothing
Exit Function
End If

Set ImageFolder = FileSystemObject.GetFolder(CompleteImagesFolderPath)

Set Files = ImageFolder.Files

i = 1


For Each File in Files

FileName = File.Name
FileExtension = Right(FileName, Len(FileName) - (InStrRev(FileName, ".")))

If InStr(1,ImageFileTypes,FileExtension,vbTextCompare) > 0 then
ImageFiles.Add i, FileName
i = i + 1
End If

Next

Set ImageFolder = nothing
Set Files = nothing
Set FileSystemObject = nothing

Randomize

If ImageFiles.Count = 0 Then
RandomImage = "Error 1: Folder no existe"
Exit Function
End If

RandomNumber = Int((ImageFiles.Count) * Rnd + 1)
Final = CompleteImagesFolderPath&"\"&ImageFiles.Item(RandomNumber)

WshShell.RegWrite "HKEY_CURRENT_USER\Software\Microsoft\Internet
Explorer\Desktop\General\Wallpaper",Final,"REG_SZ"
WshShell.RegWrite "HKEY_CURRENT_USER\Control
Panel\Desktop\Wallpaper",Final,"REG_SZ"


'CompleteImagesFolderPath&"\"&ImageFiles.Item(RandomNumber)
Set ImageFiles = nothing


WSHShell.AppActivate strDesktop
WSHShell.SendKeys "{F5}"

End Function


Preguntas similares