Introduction: NASA Image of the Day As Your Desktop!

Hello everyone! Welcome to my first instructable. In this instructable I will show you how to make a program that changes your computer’s desktop to the most recent NASA Image of the Day. These images are always stunning and the program really adds to your desktop appearance.

The NASA Image of the Day is a wonderful source of images from Earth, inside NASA, and all the way out to distant galaxies. The images are always full of color, and I have yet to see one that does not go perfectly on a 1080p or less display.

This instructable contains directions for Windows 10 and the files included should mostly be usable for other similar operating systems, but it does require Java.

All files are available, open-source, on my GitHub.

I hope you enjoy and learn a lot from my first instructable. If you have any advice for me, I’d love to hear it!

Step 1: Set Up the Startup Files

Begin by opening your startup folder. Items in this folder will automatically run when you log in. If you won't be turning off your computer often, then you can skip this step and see how to manually schedule the program to run later on in Step 5.

To enter the startup folder, open the run dialog by tying [Windows Key] + R. In the run window that opens, type “shell:startup” without quotes (first image above) then hit enter.

Now you can download and move the attached file “DesktopChanger.bat” into startup. This file is programmed to run a .jar file from a folder on your desktop, so once you’ve moved it there, you should right-click the file and click on “Edit” in the menu.

You should now see a Notepad window open with some lines of code. You will need to change the line:

cd “[FOLDER LOCATION]” <br>

(WITH quotes) to include the location of your photo, instead of the placeholder. For example, if you placed the image on a folder in your C drive, you would instead type:

cd “C:/[FOLDER LOCATION]” 

(WITH quotes.) If the item is located on a separate drive, include /d at the end of your quoted location, for example:

cd “D:\[FOLDER LOCATION]” /d

(WITH quotes.) You should use an empty folder that already exists, but without any images.

Step 2: Setting Up the Java Jar File

Now we’ll work on the folder you used earlier. If you have not already, then create the folder.

In this folder, you’ll want to include the attached file “Refresh Image.jar,” which is the main code that drives this program. You can find the source code on my github page. Make sure that the [FOLDER LOCATION] specified in the previous step is the exact folder location of the file. You can get the exact location of the file by right-clicking it in Windows Explorer and selecting "Properties," then copying the text listed beside "Location" (as in the images above.)

Now try running the Java file by double-clicking it. If you have Java properly installed, it should run without errors, and two new files named “img.jpg” and “img2.jpg” should pop up. Running it again should keep both files.

Step 3: Change Settings

Now that the files are set up, the only thing left to do is apply the settings. Go to your desktop, right-click, and select “Personalize.” This should open your settings. On Windows 8-10 this will open the Settings window (imaged above,) but on Windows 7 it should open the Control Panel.

Within the settings, you need to change a few options:

  • Under the “Background” option, set the drop-down box to “Slideshow.”
  • Under the “Choose a Fit” menu, I selected Span, since I find that is looks the best (it will resize the image so that it is cut off at the sides, so the photo will be cut down, but there won’t be any black bars or stretching of the image.
  • And you’ll need to select the folder you created which contains “Refresh Image.jar” using the “Browse” button under the “Choose albums for your slideshow” section.

Note: In Windows 7 it seems you will need to select a set of photos; you can simply select the two images "img.jpg" and "img2.jpg" after running the "Refresh Image v1.2.jar" file.

Step 4: Registry Settings

NOTE: The Windows registry is where settings, software information, and other data is saved, and it is a very important part of your computer. Using the registry improperly can ruin your computer and render it unusable. But, if you follow these directions carefully enough, you will likely not have any issues at all.

If you aren’t comfortable with modifying registry values, then you can change the setting under “Change picture every” to 1 Minute. This will work too, but it will be much slower to change your desktop to the new photo when you start up your PC.

Open the registry by pressing [Windows Key] + R to open the run dialog, then type “regedit” (without quotes) and press enter. You will need to allow regedit to make changes to your computer (press “Yes” if you are prompted.) You now should see a window that, in the top left, looks like the first image included in this step. Navigate to HKEY_CURRENT_USER > Control Panel > Personalization > Desktop Slideshow, then double click the REG_DWORD labeled “Interval” (without quotes) click the “Decimal” radio button if it is not already selected. The “Value data” should NOT contain letters when in Decimal mode. Change the value to “1000” (now more than ever; WITHOUT quotes!)

Step 5: Scheduling Events

If you don’t want to turn your computer off often, you can use the Windows Task Scheduler. If you choose to do this, try the following:

1.) Open the run dialog and type “Taskschd.msc.”

2.) In the Actions pane to the right of the Task Scheduler window, click on “Create Basic Task…”

3.) Give your new task a name and, if you want, a description.

4.) After clicking next, select daily, click next, choose the time you want the photo refresh to be executed, then click next.

5.) In this section, select the radio “Start a program,” then click next.

6.) Now, either manually enter the location of the “Refresh Image.jar” file, or use browse to find it.

Click next, then Finish.

Step 6: Done!

That's it! You should try restarting your computer next time the photo is updated, and waiting to make sure that the desktop changes within whatever time was previously set for the slideshow interval.

I hope you liked this instructable, and I hope everything in it works. I may not be able to help with some problems related to setting this up, but if I can, I'd be glad to help. Please give me advice on this (my first) instructable. Thanks for reading through, and have a nice day!

Comments

author
adrien.hagege.5 made it!(author)2017-06-02

Errr I got a lil issue : The taskmanager won't run the jar file !

Here are the settings I set up :

- Run wether user is logged or not

- Trigger : on connection to user session (on local connection to any user session) -> so it refresh everytime I log on, that's because I dont often turn my computer off. (maybe the 'log on' isn't when I log on from 'sleep' ?)

I checked the jar file path ofc

Ask for any setup you need !

Also, it doesnt work when I run the task on demand

author
Steele+Maker made it!(author)2017-06-03

If you manually run the .jar file with administrator privileges, does it show up in Task Manager, and, if so, does it give an error? If the program shows up and no error boxes open, is it not changing the image in the folder it is placed, or is your OS not updating the desktop?

author
adrien.hagege.5 made it!(author)2017-06-06

The task is continuously ran in the TM but the jar just doesn't open, even if the task is manually run or not. When I run the jar file in the folder location, the pics then the wallpaper are updated. I think the issue is the TM that can not run the task..

author
dkutsaro made it!(author)2017-05-31

It worked out great.

How to add a proxy server?

Thank You.

author
AtharvaTagalpallewar made it!(author)2017-05-28

It worked out great for me. The images are wonderful. Thank You

author
adrien.hagege.5 made it!(author)2017-05-25

Hello, so how is it to be the autor of the 'potential' best Instructables ?

'Potential' because I have one issue : the jar file won't launch and create the img used by the bat file. Please can you help me on that ?

I also noticed that my Registry doesn't save the changes : the value '1000' is saved but not the Decimal tick, it stays on the Hexodecimal box when I close and open it again. Not sure if it has it's importance..

Thanks in advance !

author
AtharvaTagalpallewar made it!(author)2017-05-28

Try renaming the .jar file to "Refresh Image.jar" (without quotes). This helped me as the name of the file attached is Refresh Image v1.2.jar but in the .bat file it is specified as "Refresh Image.jar".

Hope it helps

author
AtharvaTagalpallewar made it!(author)2017-05-28

Also remove the + sign while renaming.

author
Steele+Maker made it!(author)2017-05-25

If the jar file won't create the file, it is possible that the version of Java on your computer isn't up to date, but it seems more likely that the jar file doesn't have access to change the folder. You can try right clicking and selecting "Run as Administrator" or just moving it to a different folder such as your desktop and trying it there. Do any error boxes show up when it runs?

Also, the registry won't save that setting. As long as the decimal number stays the same.

author
adrien.hagege.5 made it!(author)2017-05-26

I checked the version of Java.

I don't have the option when I right click on it, but I have all the permissions as checked in the file properties. I had error boxes once when I tried to execute it, but the image spawned anyway. Now, I don't have any, and the image doesn't show up even if I move the jar file to the desktop. Strange huh ?

Thanks for answering btw !

author
adrien.hagege.5 made it!(author)2017-05-26

Also it doesnt work for both Refresh+image.jar and Refresh+imageV1.2.jar files

Im on W10

author
Steele+Maker made it!(author)2017-05-26

Another possibility that
I've noticed is that the .jar file might have a network issue that doesn't
result in a visible error. A slow connection or a network-side firewall might be the
issue. Does the Command Prompt window stay open when it first runs, or does it
close quickly? Also, do you know if the error you got was in writing the image or
if it was in getting the RSS?

author
adrien.hagege.5 made it!(author)2017-05-26

Ok, so it was the firewall, I allowed java.exe and it looks like it is working now.

Btw the Command prompt closed quickly and I dont remember the error, but I might be linked with the firewall issue !

In any case, that makes you the author of the best Instructables imo !

author
adrien.hagege.5 made it!(author)2017-05-26

And thank you of course !

author
RyanG237 made it!(author)2017-05-24

Nice tutorial,

I'm having difficulty getting the desktop background to change, i cant seem to set slideshow with only one image on windows 7.

All the other bits work, the image gets replaced with the new one just doesn't come onto desktop.

Any ideas please?

author
Steele+Maker made it!(author)2017-05-24

Do you know if your slideshow changes when there are multiple images in the folder?

author
RyanG237 made it!(author)2017-05-24

Hey, Yes it works when i select more than one image, i dont have the ability to select a folder like in the tutorial just individual images.

author
Steele+Maker made it!(author)2017-05-24

I don't have any access to a PC with Windows 7, so I can't test it, but I just updated the file to instead keep two files instead of deleting one. This should work, just select both files after running the program once.

author
Leomazz made it!(author)2017-05-24

I've been wanting this so long..... lol. Thank you so much! Made my day.... or... may I say...my (every)day... =)

author
ClementH made it!(author)2017-05-24

i abselutely loed it, it was my fiirst "progamming project" so to speak, great tutorial

author
jferva made it!(author)2017-05-23

yes, mac please...

author
Huffmania made it!(author)2017-05-23

How could you edit this to use a different source for the photos?

author
Steele+Maker made it!(author)2017-05-23

If your source has a set link where you can find the image's URL (my program uses an RSS feed from NASA) then you can modify the code in Main.java, on my GitHub, to use this instead. Namely that would mean changing lines 29, 34, 41, and 42. I don't think I can go too in depth in just this comment, but I can give an image to help identify what's what. The top is a part of the RSS file from NASA and the bottom is my program, starting at line 26.

Red = URL

Green = The "section" of importance

Blue = Tag name

Light Blue = A part of the tag name/more identifiers

Magenta = The link to be gotten off the internet by the program.

code explain.png
author
DannyB119 made it!(author)2017-05-23

Do you mind if i make a version of this for mac at some point?

author
Steele+Maker made it!(author)2017-05-23

Feel free to add on to this instructable however you want!

author
andrej made it!(author)2017-05-23

curl --output nasa.jpg `curl -s -o - https://www.nasa.gov/rss/dyn/lg_image_of_the_day.... | grep enclosure | head -1 | sed -e "s/.*url=\"http:/https:/g" -e "s/\" length.*//g"`

this creates nasa.jpeg in current folder

author
German_MX made it!(author)2017-05-23

For your first Instructable, it's AMAZING.

You have some serious skills at code, keep it that way.

Captura.JPG
author
LiamF5 made it!(author)2017-05-23

This works a treat!! thanks!

author
La+Technition made it!(author)2017-05-21

That is great dude. :)

author
Leon2004_ made it!(author)2017-05-21

Welcome,

So I have Windows XP, and it's possible to do this?

author
Steele+Maker made it!(author)2017-05-21

I can't guarantee anything with XP, but there seems to be one solution: the Windows PowerToys FunPack. This is the only solution I could find, but it seems like it has low ratings because it requires Windows Media Player to be installed as version 9.

author
MRM256 made it!(author)2017-05-20

There seems to be some details missing.

0. What is the Folder called?

1. How do you add the .BAT file to the startup folder?

2. How do you modify the .BAT file inside the startup folder?

3. Were do you place the "Refresh Image.jar" file?

4. Is that the Main.java program on your GitHub site?

author
Steele+Maker made it!(author)2017-05-20

0. The startup folder is built into Windows, and is plainly named "startup." You can open it by typing "shell:startup" into the run dialog ([Windows Key] + R.)

1. You can add the .BAT file by downloading from this page then moving the file (right-click > Cut) into the startup folder mentioned above (right-click > Paste.)

2. Once inside the startup folder, you can right-click the file and then click on the "Edit" option to edit the file.

3. You can place the "Refresh Image.jar" file anywhere you want, but the folder should be new so there are no other files in it.

4. The "Main.java" program is the same as the "Refresh Image.jar" file I provided in the Instructible.

author
DIY+Hacks+and+How+Tos made it!(author)2017-05-19

That's AWESOME! Thank you so much for sharing this. I am going to go change my wallpaper right now.

About This Instructable

12,051views

127favorites

License:

Bio: I am a student in high school who likes to make robots and program things in my free time. I usually design parts in Fusion ... More »
More by Steele Maker:NASA Image of the Day As Your Desktop!
Add instructable to: