Sunday, June 5, 2011

Schedule Your Wallpaper to Be Changed


I’m going to talk about how to schedule your desktops wallpaper to be a specific image (a bitmap more specifically). For this we are going to use a batch file and a freeware program called Command Line Wallpaper Changer Portable (CLWCP).Download the file here:

The program we are using will allow us to change the image and make it stretched, tiled, or centered whichever our choice may be. The batch file will send the appropriate parameters to the program for use.

Next for this tutorial we will use the windows background file BLISS.bmp. 

If you are running windows it should be already available for you somewhere on your computer otherwise you can download it here:

After downloading the image rename the file as "Bliss" (don't include the quotes and leave the .bmp extension alone).

Now lets write our Batch file. The batch file will run the CLWCP program and give it our parameters all in one file.

Open notepad and type the following (or copy it from here).


::Change Wallpaper
@echo off
Start CLCWP.exe bliss.bmp stretch



Each line explained.
We use the first line to identify what the file does.
The second line tells the command prompt window to hide our actual commands.
The third window uses Start to run the process then close the window quickly (this is the basic explanation of it). Then we are calling to run our program CLCWP.exe and telling it to use our wallpaper image BLISS.bmp and to stretch the image across the desktop. We could also have told it to center or tile the image.

With the 3 lines entered in your notepad file save the file making sure to change the file-type from “Text Documents (*.txt)” to “All Files”; use a name that explains the batch file such as “change_wallpaper.bat” making sure to add the “.bat” extension.



Choose a location to save to that you can find again later, I recommend your desktop.
When you navigate to the location you saved your batch file you’ll find a file that looks like this:


The next important thing to do is make sure our program CLCWP.exe and our wallpaper file BLISS.bmp are in a location that the batch file will find them in its search (there are a couple general locations it will look since we did not specify a location in the script). I have had success putting the two files on my desktop as well as in My Documents. That being said if you wanted to hide these files I ran into errors if they are hidden on the desktop but it still worked when hidden in My Documents.

If you want to test the file to make sure it runs you can double click the .bat file and it should change your wallpaper to the Bliss.bmp and be stretched to cover the full screen. If it does not go back to step 1 and make sure your code is correct, and that you have the files either on your desktop or in My Documents.
Setting the scheduled task to run our .bat file
Provided you have tested the .bat file and found that it does in fact change your wallpaper to the Bliss.bmp stretched across your desktop we can now go about setting a scheduled task to run the .bat file every so often, (every so often being a duration of time you get to choose).
For WindowsXP:
1.       Click the start menu > Choose Control Panel






2.       Choose “Scheduled Tasks”


 
     Choose “Add Scheduled Task”


4.      Click “Next”




5.       Choose “Browse”


6.       Locate the .bat file we created, select it, then choose “Open”


7.       Give the Scheduled Task a meaningful name like “Change_Wallpaper”, and choose when you want the file to run. For the purpose of this tutorial we will tell it to run Daily so we can later tell it to run every 10 minutes. Click “Next”.




8.       Because chose to run this task “Daily” we now specify a little when to run it. Choose a time to start running the task at, select “Every Day”, then make sure the “Start date” reads the current date, then and click “Next”.

9.       The username field should auto-populate with your users login name, if not provide your user login name and password here, then click “Next”.
 

    10.       This is our last page to create the Scheduled Task. Select the option to “Open advanced properties for this task when I click Finish”, and then choose “Finish”.

11.       After we clicked “Finish” it should prompt us with the advanced settings of the Scheduled Task. Choose the “Schedule” tab on top, and then click the “Advanced” button.

      12.    Within our Advanced Schedule Options we are now going to set a few parameters. The Start Date was already set so we don’t need to worry about that (unless you want to change it). Select “Repeat task” and tell it to repeat running our .bat file every “10” “Minutes” (you can obviously change these values to accommodate your own individual needs. You can now tell it to run until a set time or a set number of durations. I have chosen “Time” so the event will run until “10:30 pm”. Click “Next” and then if asked to click “Apply”.




Your scheduled task is now ready to set your Wallpaper to the Bliss.bmp background every 10 minutes starting at 7 in the morning and ending at 10:30 at night. You can change the frequency of when our .bat file runs and you can choose to change the wallpaper (still needs to be a .bmp file though). Now if your little brothers or sisters change your computers desktop every time you walk away you can have it set back to your chosen background every minute if need be.