0使用脚本启用 Windows 桌面幻灯片

I’ve been updat­ing my unat­ten­ded win­dows deploy­ment setup recently, and one of the things I wanted to enable was the slideshow wall­pa­per with the loc­a­tion set to my wall­pa­pers loc­a­tion on my serv­er. This isn’t as straight-for­ward as it ought to be, but after bit of fid­dling around I figured out how to do it fairly simply.

2 parts are neede — a reg script and copy­ing a file (which I do via a self-extract­ing archive file).

reg脚本如下

Windows注册表编辑器版本 5.00

[HKEY_CURRENT_USER控制面板个性化桌面幻灯片]
"间隔"=双字:000927c0
"随机播放"=双字:00000001

[HKEY_CURRENT_USERSOFTWAREMicrosoftWindowsCurrentVersionExplorerWallpapers]
"幻灯片源目录集"=双字:00000001
"背景类型"=双字:00000002
"幻灯片目录路径 1"="/长长的随机字符串在这里"

Note — you will need to set up the slideshow with the cor­rect path on one of your 电脑 and then export the value for “SlideshowDirectoryPath1” from your registry for this to work

第二部分是复制一个名为slideshow.ini的文件 (also after set­ting up your own slideshow) 住在 %appdata%\Microsoft\Windows\Themes

The con­tents of this file con­tain an encoded ref­er­ence to the loc­a­tion of your slideshow I believe.

Once you have copied the file and impor­ted the reg file you just need to restart explorer or wait for the inter­val peri­od to pass (我的设置为 10 分钟) and I have shuffle turned on — your val­ues may be dif­fer­ent if you set them dif­fer­ently and export the changed val­ues from the registry

I have put my slideshow.ini into a self-extract­ing exe that extracts to (并默默地覆盖) %appdata%\Microsoft\Windows\Themes. 然后我运行我的 2 com­mands using the fol­low­ing Syn­chron­ousCom­mands in my ImageUnattend.xml

<同步命令 wcm:动作="加">
  <命令>6</命令>
  <描述>设置幻灯片位置</描述>
  <命令行>Ç:\附加幻灯片.exe</命令行>
</同步命令>
<同步命令 wcm:动作="加">
  <命令>7</命令>
  <描述>启用幻灯片</描述>
  <命令行>Ç:\附加提升 -c reg import c:\附加幻灯片.reg</命令行>
</同步命令>

For more inform­a­tion about my use of the com­mand “elev­ate” and hav­ing files in the c:\extras folder please read my pre­vi­ous art­icle about how I used a “根据保留的 DHCP 名称重命名 PC 的批处理脚本

有你自己的一些想法? 下面放纵自己通过评论! 如果您想订阅,请使用菜单上的订阅链接右上方. 您还可以通过使用下面的链接社会分享这与你的朋友. 干杯.

Leave a Reply