Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 9 of 9
  1. #1
    New Coder
    Join Date
    Aug 2008
    Location
    Earth
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question Change a desktop background using Batch?

    Hiya,
    I already browsed google and I don't think I had any luck.
    Is it possible to change a desktop background using a batch file?
    If so can somebody please write the code, I really appreciate it.

    I already tried this one:

    reg /add HKCU\Control Panel\Desktop\WallPaper /v wallpaper /t REG_SZ /d D:\mysetts\image.png

    but it ends up saying:

    Error: Bad Operation.

  • #2
    Regular Coder
    Join Date
    May 2008
    Location
    Lost in Localhost...
    Posts
    702
    Thanks
    3
    Thanked 43 Times in 42 Posts
    Damn, just realized you have tried what I suggested.
    Are you sure you have the path correct?
    Code:
    D:\mysetts\image.png
    Is this where your image is?
    Last edited by Millenia; 12-04-2008 at 05:48 PM.

  • #3
    Rockstar Coder
    Join Date
    Jun 2002
    Location
    USA
    Posts
    9,074
    Thanks
    1
    Thanked 328 Times in 324 Posts
    Do you have permissions on the computer to change the background?
    OracleGuy

  • #4
    New Coder
    Join Date
    Aug 2008
    Location
    Earth
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Yeah, the image location is correct.
    But I'm not sure with the permissions to change the background,
    how can I tell if I'm permitted? O.o;

  • #5
    Rockstar Coder
    Join Date
    Jun 2002
    Location
    USA
    Posts
    9,074
    Thanks
    1
    Thanked 328 Times in 324 Posts
    If you right click on the desktop and go to the properties, can you manually set the background there?
    OracleGuy

  • #6
    New Coder
    Join Date
    Aug 2008
    Location
    Earth
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Yeah, though I'm interested on how to do it using batch...

  • #7
    Regular Coder
    Join Date
    May 2008
    Location
    Lost in Localhost...
    Posts
    702
    Thanks
    3
    Thanked 43 Times in 42 Posts
    Quote Originally Posted by silverpaws006 View Post
    Yeah, though I'm interested on how to do it using batch...
    He means you need to do that to see if you have the permissions to change the background.

    If your doing it via the registry, wouldn't it be pointless for the batch? Because you would have to restart for it to take effect.

  • #8
    New Coder
    Join Date
    Aug 2008
    Location
    Earth
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Oh, okay, nvm then.
    Thanks anyways.^^
    I guess you can close this thread now^^

  • #9
    Regular Coder
    Join Date
    May 2008
    Location
    Lost in Localhost...
    Posts
    702
    Thanks
    3
    Thanked 43 Times in 42 Posts
    Code:
    @echo off
    call :quiet>nul 2>&1
    goto :EOF
    :quiet
    :: Configure Wallpaper 
    REG ADD "HKCU\Control Panel\Desktop" /V Wallpaper /T REG_SZ /F /D "%SystemRoot%\energybliss.bmp"
    REG ADD "HKCU\Control Panel\Desktop" /V WallpaperStyle /T REG_SZ /F /D 0
    REG ADD "HKCU\Control Panel\Desktop" /V TileWallpaper /T REG_SZ /F /D 2
    :: Make the changes effective immediately
    %SystemRoot%\System32\RUNDLL32.EXE user32.dll, UpdatePerUserSystemParameters
    Try modifying this to suit your needs.
    As I said, when changing things via the registry, you usually have to log off and back on again for the changes to take affect. However this piece of code makes the changes immedietely:
    Code:
    %SystemRoot%\System32\RUNDLL32.EXE user32.dll, UpdatePerUserSystemParameters


  •  

    Tags for this Thread

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •