1
1
I need to open it on startup to change the wallpaper at day n night
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
This is the vbs that will open batch files that will change the Reg
Batch file for day
@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
Batch file for night
@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
but when i use the vbs it did not change the registry
Please Help
Thanks
Why don't you just create a task in windows to start each batch at a specific time? – FatalBulletHit – 2018-02-08T15:15:22.977
@FatalBulletHit ,I want to change it this way, Day=00 to 16 and Night=15 to 23 – Anuja Nimesh – 2018-02-08T15:27:32.863
So you create a task at 00:00 and 16:00 which starts the corresponding batch. And if you want to check and change it at system start you create a batch which checks the time and starts the corresponding batch file as well. I don't know how Windows handles tasks when it's in stand-by or sleep, but other than that, tasks should work just fine. :) – FatalBulletHit – 2018-02-08T16:02:46.263
@FatalBulletHit , then it'll change only at 00.00 and 16.00 right ?,I want to change when I turn my PC on ,not just at 00.00 and 16.00 – Anuja Nimesh – 2018-02-09T14:03:31.683
"And if you want to check and change it at system start you create a batch which checks the time and starts the corresponding batch file as well." Maybe I should add: put it in Autostart or use Windows task scheduler... – FatalBulletHit – 2018-02-09T14:06:54.580