0

hello
i am trying to make a cmd file to change my background.
this is the cmd i am trying to use:

REG ADD HKCU\Control Panel\Desktop /v Wallpaper /t REG_SZ /d C:\Windows\newbackground.bmp /f

what am i doing wrong?
when i enter this on cmd i get: invalid syntax. type reg add /? for usage.

thankyou in advance

2
Contributors
4
Replies
7
Views
7 Years
Discussion Span
Last Post by airbourne
0

If this is a .BAT file, you will have to run it or the associated command prompt window with Administrative privileges to get this to work.

Also, for your syntax problem, try this:

REG ADD "HKCU\Control Panel\Desktop" /v Wallpaper /t REG_SZ /d C:\Windows\newbackground.bmp /f

I also found on the web, you can add this line in the batch file to refresh the desktop:

%SystemRoot%\System32\RUNDLL32.EXE user32.dll, UpdatePerUserSystemParameters

Edited by airbourne: n/a

0

i now get: the cmd completed sucessfully
and the wallpaper doesnt change. i navigate to the value in regedit and it shows the path of the bmp file(good): "C:\Users\TheGang\Desktop\Adams Folder\Random\batch\hiddenpic.bmp"

and yes i added the refresh value but it still doesnt change :(
thnx 4 ur reply in advance :)

0

i now get: the cmd completed sucessfully
and the wallpaper doesnt change. i navigate to the value in regedit and it shows the path of the bmp file(good): "C:\Users\TheGang\Desktop\Adams Folder\Random\batch\hiddenpic.bmp"

and yes i added the refresh value but it still doesnt change :(
thnx 4 ur reply in advance :)

just closing off this thread with a conclusion:
the batch script worked perfectly. all i had to do is restart my computer.
here is the final script: @echo off
REG ADD "HKCU\Control Panel\Desktop" /v Wallpaper /t REG_SZ /d "picture_location.bmp" /f
%SystemRoot%\System32\RUNDLL32.EXE user32.dll
restart

thanks to those who replied for their help :)

0

Yeah, a reboot would take care of it. A log off and back on might as well. The second line in the code was suppose to do it without having to reboot.

Anyway, glad it worked!

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.