Changing Wallpaper With VB
-Wolfe
Phoenix wolfe wrote:
I'm trying to find/make a vb script ( .vbs file for win xp) that will change the Windows Desktop background (for current user only). I am new to VB so any help anyone could give would be nice. Hope someone can/may/will help.
-Wolfe
Unfortunately, the only way to access this information in VB script is to use the WMI classes, specifically the Win32_Desktop class. However, the Wallpaper property for this class is read-only, so you can't set it in your script.
The only way I can think of doing this would be to write a COM object which would call the API, and then call that from your VB script. However, if you are going to go that far, you might as well write a small application to do it.
Hope this helps.
- Nicholas Paldino [.NET/C# MVP]
- mvp@spam.guard.caspershouse.com
Phoenix wolfe wrote:
have any suggestions for how to learn com objects calling the api from vb? Ie: book titles isbn's etc etc.. And yes, i probably will end up writing a small app to do this, though id really rather not. I'm downloading visual studio 2003 and will intall that tonight, as well as download afew books on com objects.
anyway thanks :}
If you are installing VS.NET 2003, then I would recommend that you just use VB.NET to create your app to do this. To try and do it through script isn't worth it.
- Nicholas Paldino [.NET/C# MVP]
- mvp@spam.guard.caspershouse.com
Here is another code snippet you can try in your VB.NET application .EXE (see link):
http://www.devcity.net/Articles/119/vb2005_wallpaper.aspx
Jay and I worked on this code for a demo where we take wallpaper from the Movie Collection starter kit ![]()
hope that helps,
Paul