Новый участник
Сообщения: 2
Благодарности: 0
|
Профиль
|
Отправить PM
| Цитировать
Такого типа VBS скрипт отрабатывает у меня и ставит обои нужного разрешения:
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colItems = objWMIService.ExecQuery _
("Select * From Win32_DisplayConfiguration")
For Each objItem in colItems
dim wshShell
dim sUserName'
' --------- FOR 1920 x 1200 -------------
If objItem.PelsWidth="1920" AND objItem.PelsHeight="1200" then
Set wshShell = WScript.CreateObject("WScript.Shell")
sUserName = wshShell.ExpandEnvironmentStrings("%USERNAME%")
Set oShell = CreateObject("WScript.Shell")
Set oFSO = CreateObject("Scripting.FileSystemObject")
sWinDir = oFSO.GetSpecialFolder(0)
sWallPaper = "\\hyper\GP Soft\Wallpapers\New\logo_CMSO_1920-1200.bmp"
oShell.RegWrite "HKCU\Control Panel\Desktop\Wallpaper", sWallPaper
oShell.Run "%windir%\System32\RUNDLL32.EXE user32.dll,UpdatePerUserSystemParameters", 1, True
END IF
' --------- FOR 1280 x 1024 -------------
If objItem.PelsWidth="1280" AND objItem.PelsHeight="1024" then
Set wshShell = WScript.CreateObject("WScript.Shell")
sUserName = wshShell.ExpandEnvironmentStrings("%USERNAME%")
Set oShell = CreateObject("WScript.Shell")
Set oFSO = CreateObject("Scripting.FileSystemObject")
sWinDir = oFSO.GetSpecialFolder(0)
sWallPaper = "\\hyper\GP Soft\Wallpapers\New\logo_CMSO_1280-1024.bmp"
oShell.RegWrite "HKCU\Control Panel\Desktop\Wallpaper", sWallPaper
oShell.Run "%windir%\System32\RUNDLL32.EXE user32.dll,UpdatePerUserSystemParameters", 1, True
END IF
' --------- FOR 1280 x 800 -------------
If objItem.PelsWidth="1280" AND objItem.PelsHeight="800" then
Set wshShell = WScript.CreateObject("WScript.Shell")
sUserName = wshShell.ExpandEnvironmentStrings("%USERNAME%")
Set oShell = CreateObject("WScript.Shell")
Set oFSO = CreateObject("Scripting.FileSystemObject")
sWinDir = oFSO.GetSpecialFolder(0)
sWallPaper = "\\hyper\GP Soft\Wallpapers\New\logo_CMSO_1280-800.bmp"
oShell.RegWrite "HKCU\Control Panel\Desktop\Wallpaper", sWallPaper
oShell.Run "%windir%\System32\RUNDLL32.EXE user32.dll,UpdatePerUserSystemParameters", 1, True
END IF
' --------- FOR 1024 x 768 -------------
If objItem.PelsWidth="1024" AND objItem.PelsHeight="768" then
Set wshShell = WScript.CreateObject("WScript.Shell")
sUserName = wshShell.ExpandEnvironmentStrings("%USERNAME%")
Set oShell = CreateObject("WScript.Shell")
Set oFSO = CreateObject("Scripting.FileSystemObject")
sWinDir = oFSO.GetSpecialFolder(0)
sWallPaper = "\\hyper\GP Soft\Wallpapers\NEW\logo_CMSO_1024-768.bmp"
oShell.RegWrite "HKCU\Control Panel\Desktop\Wallpaper", sWallPaper
oShell.Run "%windir%\System32\RUNDLL32.EXE user32.dll,UpdatePerUserSystemParameters", 1, True
END IF
' --------- FOR 800 x 600 -------------
If objItem.PelsWidth="800" AND objItem.PelsHeight="600" then
Set wshShell = WScript.CreateObject("WScript.Shell")
sUserName = wshShell.ExpandEnvironmentStrings("%USERNAME%")
Set oShell = CreateObject("WScript.Shell")
Set oFSO = CreateObject("Scripting.FileSystemObject")
sWinDir = oFSO.GetSpecialFolder(0)
sWallPaper = "\\hyper\GP Soft\Wallpapers\Main\logo_CMSO_1280-1024.bmp"
oShell.RegWrite "HKCU\Control Panel\Desktop\Wallpaper", sWallPaper
oShell.Run "%windir%\System32\RUNDLL32.EXE user32.dll,UpdatePerUserSystemParameters", 1, True
END IF
' --------- FOR 1400 x 1050 -------------
If objItem.PelsWidth="1400" AND objItem.PelsHeight="1050" then
Set wshShell = WScript.CreateObject("WScript.Shell")
sUserName = wshShell.ExpandEnvironmentStrings("%USERNAME%")
Set oShell = CreateObject("WScript.Shell")
Set oFSO = CreateObject("Scripting.FileSystemObject")
sWinDir = oFSO.GetSpecialFolder(0)
sWallPaper = "\\hyper\GP Soft\Wallpapers\Main\logo_CMSO_1680-1050.bmp"
oShell.RegWrite "HKCU\Control Panel\Desktop\Wallpaper", sWallPaper
oShell.Run "%windir%\System32\RUNDLL32.EXE user32.dll,UpdatePerUserSystemParameters", 1, True
END IF
' --------- FOR 1680 x 1050 -------------
If objItem.PelsWidth="1680" AND objItem.PelsHeight="1050" then
Set wshShell = WScript.CreateObject("WScript.Shell")
sUserName = wshShell.ExpandEnvironmentStrings("%USERNAME%")
Set oShell = CreateObject("WScript.Shell")
Set oFSO = CreateObject("Scripting.FileSystemObject")
sWinDir = oFSO.GetSpecialFolder(0)
sWallPaper = "\\hyper\GP Soft\Wallpapers\New\logo_CMSO_1680-1050.bmp"
oShell.RegWrite "HKCU\Control Panel\Desktop\Wallpaper", sWallPaper
oShell.Run "%windir%\System32\RUNDLL32.EXE user32.dll,UpdatePerUserSystemParameters", 1, True
END IF
Next
|