过期罐头电脑论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 2773|回复: 0
收起左侧

让PE冒气泡提示的代码

[复制链接]
yaojian 2012-12-11 08:10:40 | 显示全部楼层
代码如下:
@echo off
title 更换壁纸
setlocal enableDelayedExpansion
set pic=%1
if "!pic!"=="" call :search
if "!pic!"=="" set pic="%userProfile%\Local Settings\Application
Data\Microsoft\Wallpaper1.bmp"
echo 正在添加注册表项目...
reg add "HKCU\Control Panel\Desktop" /v Wallpaper /d !pic! /f>nul
reg add "HKCU\Control Panel\Desktop" /v WallpaperStyle /d "2" /f>nul
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\System" /v Wallpaper /d !
pic! /f>nul
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\System" /v WallpaperStyle
/d "2" /f>nul
echo 正在更换桌面背景
RunDll32.exe USER32.DLL,UpdatePerUserSystemParameters
goto :eof
:search
 cd/d "%~dp0"
 for /f "delims=" %%a in ('dir/b *.jpg *.bmp') do (
  set pic="%~dp0%%a"
 )
 goto :eof
============================================================
::确保有"%userProfile%\Local Settings\Application Data\Microsoft\Wallpaper1.bmp"
@echo off
title 还原壁纸
set pic="%userProfile%\Local Settings\Application Data\Microsoft\Wallpaper1.bmp"
echo 正在添加注册表项目...
reg add "HKCU\Control Panel\Desktop" /v Wallpaper /d %pic% /f>nul
reg add "HKCU\Control Panel\Desktop" /v WallpaperStyle /d "2" /f>nul
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\System" /v Wallpaper /d %
pic% /f>nul
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\System" /v WallpaperStyle
/d "2" /f>nul
echo 正在还原桌面背景
RunDll32.exe USER32.DLL,UpdatePerUserSystemParameters
goto :eof
  分两步完成,这是目前不用THEMEUI.DLL支持也能换JPG背景的办法
您需要登录后才可以回帖 登录 | 注册

本版积分规则

一键重装系统|雨人系统下载|联系我们|网站地图|过期罐头电脑论坛

GMT+8, 2024-11-20 15:21 , Processed in 0.034434 second(s), 25 queries .

官方免责声明:本站内容来自网友和互联网.若侵犯到您的版权.请致信联系,我们将第一时间删除相关内容!

Powered by Discuz!

专注于win7_win10_win11系统下载装机

© 2010-2023 GQGTPC.Com

快速回复 返回顶部 返回列表