Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

AD script kixtart usage IV (user Desktop background)

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/03 Report--

In the http://windyma.blog.51cto.com/661702/1967027 article, it has been set up on the basis of user scripts.

First of all, setting the user background desktop is the Bginfo tool of the micro software, while kixtart is only used to obtain the resolution of the user screen, and then call the Bginfo tool to set the background picture of different resolution according to the resolution of different screen, so as to ensure that the picture will not be deformed.

First, create a new Bginfo directory under the domain\\ nccn.int\ NETLOGON share, and copy all the Bginfo.exe tools and background images of different resolutions to the Bginfo directory.

Second, use the Bginfo.exe tool to set up the content that needs to be displayed on the desktop (such as mine, the upper right corner is a simple description of phone calls, and the lower right corner is the computer-related information and the contact number of IT), point Backgroud, select a different resolution background image file under use these setting: and confirm it. Save it under\\ nccn.int\ NETLOGON\ Bginfo, named 1280-1024.bgi file (if the resolution of this background image file is 1280x1024), and do the same for other resolution backgrounds

Third, after preparation, create a new script file Function.kix under\\ nccn.int\ NETLOGON\ to define a funciton to obtain the resolution of the user's screen, so that it can be called by kixtart.kix, as follows:

This function comes from the official case of kixtart and has made some changes according to your own needs.

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 Else $RKey= "HKLM\ Config\ 0001\ Display\ Settings" If KeyExist ($RKey) $GetScreenRes = ReadValue ($RKey, "Resolution") EndIf EndIfEndFunctionFUNCTION 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 @ errorENDFUNCTION

Fourth, after defining the function, we add the following to the kixtart.kix:

; first call the custom Function.kix

CALL "% logonserver%\ NETLOGON\ Function.kix"; get the user screen resolution and assign the variable $ScreenRes$ScreenRes = GetScreenRes (); call the bginfo.exe tool IF EXIST ("% logonserver%\ netlogon\ Bginfo\ $ScreenRes.bgi") RUN "% logonserver%\ netlogon\ Bginfo\ bginfo.exe / nolicprompt% logonserver%\ netlogon\ Bginfo\ $ScreenRes.bgi / timer:00" ELSERUN "% logonserver%\ netlogon\ Bginfo\ bginfo.exe / nolicprompt% logonserver%\ netlogon\ Bginfo\ wallpaper.bgi / timer:00" ENDIF

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report