Changing a background in a batch script

Reply

Join Date: Aug 2006
Posts: 917
Reputation: linux is an unknown quantity at this point 
Solved Threads: 27
linux's Avatar
linux linux is offline Offline
Posting Shark

Changing a background in a batch script

 
0
  #1
Dec 19th, 2006
Is it possible to set a desktop background using batch? Meaning have a batch file open on start-up and then change the background to a jpeg of my choice? For example, my school's pcs are not set to retain the background after log-off. I always have to set my UNIX background every time I boot up, as does everyone else. I think it would be a nice feature to have a batch script move itself to /startup and then start and change the background.
Toshiba M1151.49 GB DDR-2 RAM1.6 GHz Centrino Duo80GB HDDWindows XP Media Center Edition
Reply With Quote Quick reply to this message  
Join Date: Oct 2004
Posts: 348
Reputation: paradox814 is an unknown quantity at this point 
Solved Threads: 4
paradox814's Avatar
paradox814 paradox814 is offline Offline
Posting Whiz

Re: Changing a background in a batch script

 
0
  #2
Dec 20th, 2006
go here: http://www.winguides.com/registry/display.php/1097/

they show how to hack the registry to change the background. Be wary of that hack, because I believe it might actually be in: HKEY USERS\ .DEFAULT\Control Panel\Desktop

just remember hacking the registry can result in very bad things happening!

Now just create a simple registry hack ie: background.reg
and place it in the startup folder, you might have to right click the desktop and click refresh for the change to happen
Reply With Quote Quick reply to this message  
Join Date: Aug 2006
Posts: 917
Reputation: linux is an unknown quantity at this point 
Solved Threads: 27
linux's Avatar
linux linux is offline Offline
Posting Shark

Re: Changing a background in a batch script

 
0
  #3
Dec 21st, 2006
I don't have access to the registry either. Using the command prompt I can get to the start-up folder, but not by My Computer.

I also shouldn't be able to access the command prompt, but I made a batch script like below, which allows me to open the application.
command
cls
Toshiba M1151.49 GB DDR-2 RAM1.6 GHz Centrino Duo80GB HDDWindows XP Media Center Edition
Reply With Quote Quick reply to this message  
Join Date: Jul 2009
Posts: 1
Reputation: Husband is an unknown quantity at this point 
Solved Threads: 0
Husband Husband is offline Offline
Newbie Poster

Re: Changing a background in a batch script

 
0
  #4
Jul 10th, 2009
I know this thread is very old, but it appears no one out there has made this work effectively. I managed to do so today by using the following. Hopefully this helps someone that stumbles upon this on Google:

@ECHO OFF
:: Written by Eric Husband
:: 7/10/2009
:: copies the wallpaper from a location into the proper directory and as the proper file name. DO NOT CHANGE THE DESTINATION FILE NAME.
copy "\\ehusband-x1\ERIC\wallpaper1.bmp" "C:\Documents and Settings\%USERNAME%\Local Settings\Application Data\Microsoft\wallpaper1.bmp"
:: Adds the necessary Registry values, in case this person is using a System Wallpaper. If they've already customized their wallpaper, the following lines are not necessary. They won't hurt though.
REG ADD "HKCU\Control Panel\Desktop" /V Wallpaper /T REG_SZ /F /D "C:\Documents and Settings\%USERNAME%\Local Settings\Application Data\Microsoft\wallpaper1.bmp"
:: Change the last number in the following line to a 0 if you want to center the bitmap on the desktop. Change the last number in the following line to a 2 if you want to stretch the bitmap vertically and horizontally to fit the desktop.
REG ADD "HKCU\Control Panel\Desktop" /V WallpaperStyle /T REG_SZ /F /D 2
:: Change the last number in the following line to a 0 to not tile the image; setting it to a 1 Tiles it.
REG ADD "HKCU\Control Panel\Desktop" /V TileWallpaper /T REG_SZ /F /D 0
:: The following line refreshes the desktop.
%SystemRoot%\System32\RUNDLL32.EXE user32.dll, UpdatePerUserSystemParameters
:: The following line Locks the workstation.
%SystemRoot%\System32\RUNDLL32.EXE user32.dll, LockWorkStation
Last edited by Husband; Jul 10th, 2009 at 9:19 pm.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the Windows NT / 2000 / XP Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC