标签:windows kixtart 脚本ad 背景桌面设置
在http://windyma.blog.51cto.com/661702/1967027文章,已做好用户脚本基础上进行设置
首先设置用户背景桌面是微软件的Bginfo工具,而kixtart只是用来获取用户屏幕的分辨率,根据不同屏幕的分辨率再来调用Bginfo工具来设置不同分辨率的背景图片,以此保证图片不会变形。
第一,在域\\nccn.int\NETLOGON 共享下新建Bginfo目录,把Bginfo.exe工具及不同分辨率的背景图全复制到Bginfo目录下。
第二,用Bginfo.exe工具设置上桌面上需要显示内容(如我的,右上解是电话拨打简单说明,右下角是计算机相关信息及IT的联系电话),点Backgroud,在use these setting:下选择不同的分辨率的背景图文件,确认后。保存在\\nccn.int\NETLOGON\Bginfo下,名为1280-1024.bgi文件(假如这个背景图文件的分辨率为1280x1024),其它分辨率背景一样操作
第三,准备后,在\\nccn.int\NETLOGON\下新建脚本文件Function.kix用于定义一个获取用户屏幕的分辨率的funciton,以便于kixtart.kix调用,如下内容:
-----------------------------------
;些function来自kixtart官方的案例,根据自行需要作了一些更改
Function GetScreenRes()
Dim $Dev,$Idx,$RKey,$ScreenXRes,$ScreenYRes,$SType
$GetScreenRes = ‘‘
If @InWin = 1
If Split(@ProductType)[1] <> "NT"
$Dev = Split(‘‘ + WMIQuery("VideoModeDescription","Win32_VideoController"))
If UBound($Dev) > 1
$GetScreenRes = $Dev[0] + "-" + $Dev[2]
EndIf
Else
$RKey="HKLM\SYSTEM\CurrentControlSet\Hardware Profiles\Current\System\CurrentControlSet\Services"
$Dev = "\Device0"
If KeyExist($RKey)
$Idx = 0
Do
$SType = EnumKey($RKey,$Idx)
If @Error = 0 And $SType <> "VgaSave"
$ScreenXRes = ‘‘ + ReadValue($RKey + "\" + $SType + $Dev,"DefaultSettings.XResolution")
$ScreenYRes = ‘‘ + ReadValue($RKey + "\" + $SType + $Dev,"DefaultSettings.YResolution")
Else
$Idx = $Idx + 1
EndIf
Until @Error Or $ScreenXRes
If $ScreenXRes
$GetScreenRes = $ScreenXRes + ‘-‘ + $ScreenYRes
EndIf
EndIf
EndIf
Else
$RKey="HKLM\Config\0001\Display\Settings"
If KeyExist($RKey)
$GetScreenRes = ReadValue($RKey,"Resolution")
EndIf
EndIf
EndFunction
FUNCTION WMIQuery($what,$where, optional $computer)
dim $strQuery, $objEnumerator, $value
if not $computer $computer="@WKSTA" endif
$strQuery = "Select $what From $where"
$SystemSet = GetObject("winmgmts:{impersonationLevel=impersonate}!//$computer")
$objEnumerator = $SystemSet.ExecQuery($strQuery)
For Each $objInstance in $objEnumerator
If @Error = 0 and $objInstance <> ""
$=execute("$$value = $$objInstance.$what")
$WMIQuery="$value"+""+"$WMIQuery"
EndIf
Next
$WMIQuery=left($WMIQuery,len($WMIQuery)-1)
exit @error
ENDFUNCTION
第四,定义好function后,我们在kixtart.kix中添加如下内容:
-----------------------------------
;首先调用自定义的Function.kix
CALL "%logonserver%\NETLOGON\Function.kix"
$ScreenRes = GetScreenRes()
;首先调用bginfo.exe工具
IF EXIST("%logonserver%\netlogon\Bginfo\$ScreenRes.bgi")
RUN "%logonserver%\netlogon\Bginfo\bginfo.exe /nolicprompt %logonserver%\netlogon\Bginfo\$ScreenRes.bgi /timer:00"
ELSE
RUN "%logonserver%\netlogon\Bginfo\bginfo.exe /nolicprompt %logonserver%\netlogon\Bginfo\wallpaper.bgi /timer:00"
ENDIF
本文出自 “water-ice” 博客,请务必保留此出处http://windyma.blog.51cto.com/661702/1967071
标签:windows kixtart 脚本ad 背景桌面设置
原文地址:http://windyma.blog.51cto.com/661702/1967071