
밤낮으로 배경화면을 변경하려면 시작할 때 열어야 합니다
Dim objShell
str1 = "C:\Users\AnB\Desktop\Texts\Projects\Project WallTime\Day.bat"
str2 = "C:\Users\AnB\Desktop\Texts\Projects\Project WallTime\Night.bat"
Set objShell = Wscript.CreateObject("WScript.Shell")
if hour(time) < 17 then
objShell.Run str1
if hour(time) > 16 then
objShell.Run str2
end if
end if
이것은 Reg를 변경하는 배치 파일을 여는 VBS입니다.
하루 동안의 배치 파일
@echo off
reg add "HKEY_CURRENT_USER\Control Panel\Desktop" /v Wallpaper /t REG_SZ /d "C:\Users\AnB\Desktop\Texts\Projects\Project WallTime\Day and Night\Day.png" /f
RUNDLL32.EXE user32.dll,UpdatePerUserSystemParameters
야간 배치 파일
@echo off
reg add "HKEY_CURRENT_USER\Control Panel\Desktop" /v Wallpaper /t REG_SZ /d "C:\Users\AnB\Desktop\Texts\Projects\Project WallTime\Day and Night\Night.png" /f
RUNDLL32.EXE user32.dll,UpdatePerUserSystemParameters
하지만 VBS를 사용할 때 레지스트리가 변경되지 않았습니다.
도와주세요
감사해요
답변1
그랬어요, 도와주셔서 감사해요
@Echo Off
Set "locn=%UserProfile%\Desktop\Texts\Projects\Project WallTime\Day and Night"
Set "rstr=Reg Add "HKCU\Control Panel\Desktop" /V Wallpaper /D "
Set "str1=%locn%\Day.png"
Set "str2=%locn%\Night.png"
Set /A "now=10%TIME:~,2%" 2>Nul
If %now:~-2% Lss 17 (%rstr% "%str1%" /F >Nul
) Else %rstr% "%str2%" /F >Nul
RunDll32 User32.dll,UpdatePerUserSystemParameters >Nul