需要帮助使这个脚本成为现实。我想第一部分是做文件,但注册表需要反映从信息4-8谢谢你。
1‘这个vbscript应该命名为DefualtWallpaper.vbs
2‘将此文件复制到文件夹中。
3 'cat.jpg图像应该在与vbscript相同的文件夹中。
dim filesys
set filesys=CreateObject("Scripting.FileSystemObject")
If filesys.FileExists("%cd%\cat.jpg%") Then
filesys.CopyFile "%cd%\cat.jpg%","%windir%\web\wallpaper\windows"4.将注册表更改为新文件
Set WShellObj=createobject("WScriptShell")
WShellObject.RegWrite "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\DesktopBackground","%WINDIR%\WINDOWS\Web\Wallpaper\Windows\cat.bmp","REG_EXPAND_SZ"
Set WShellObj=nothingHKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\ThemesREG_EXPAND_SZDesktopBackground%WINDIR%\WINDOWS\Web\Wallpaper\Windows\cat.bmp发布于 2014-02-23 18:09:22
试一试这个从香料论坛:
reg.exe load HKU\DefUser "C:\Documents and Settings\Default User\ntuser.dat"
reg.exe add "HKU\DefUser\Control Panel\Desktop" /v Wallpaper /d "c:\windows\wallpaper\desktop.bmp" /f
reg.exe unload HKU\DefUser链接在这里:http://community.spiceworks.com/scripts/show/327-batch-file-to-set-the-default-wallpaper
发布于 2018-10-05 21:22:09
此VBScript用于:
1-以管理员身份运行脚本
2-将图像复制到保存背景图像的目录中。
3-将当前的桌面背景图像更改为注册表中的“我”图像。
4-强制注销当前用户以应用更改
'run the script as Administrator
If WScript.Arguments.Length=0 Then
CreateObject("Shell.Application").ShellExecute "wscript.exe",Chr(34)&WScript.ScriptFullName&Chr(34)&" Admin",Null,"runas",1
WScript.Quit
End If
'copy the image from to
Dim WShellObj : Set WShellObj=createobject("WScript.Shell")
Dim filesys : set filesys=CreateObject("Scripting.FileSystemObject")
If filesys.FileExists(WShellObj.ExpandEnvironmentStrings("%cd%")&"\cat.jpg") Then
WShellObj.Run "cmd.exe /c copy ""%cd%\cat.jpg"" %windir%\web\wallpaper\windows",0,False
End If
'change desktop wallpaper through registry
WShellObj.RegWrite "HKEY_CURRENT_USER\Control Panel\Desktop\Wallpaper","%WINDIR%\Web\Wallpaper\Windows\cat.jpg","REG_SZ"
'force log off to apply the change of wallpaper
Dim oSystem
For Each oSystem In GetObject ("winmgmts:{(Shutdown)}//./root/cimv2").ExecQuery("select * from Win32_OperatingSystem")
oSystem.Win32Shutdown 4
Nexthttps://stackoverflow.com/questions/21971471
复制相似问题