Jump to content

commandline change wallpaper


Recommended Posts

Posted

i am really sorry for this question, but is there a commandline command to change the current wallpaper to another file. just changing the rigistry entry does not do the thing. plz help.


Posted

you cannot directly change it from prompt, you need to access a dll to do that, and to do that you need to use VB Script, because you can load the DLL and make changes. http://www.planet-source-code.com/vb/scrip...d=3201&lngWId=1 is a little dumb script to change your desktop wallpaper to dilbert each day. But it shows you how to make the access that you need. This is the most important line.

ChangeWallPaper.vbs

Declare Function SystemParametersInfo Lib "user32" Alias "SystemParametersInfoA" (ByVal uAction As Long, ByVal uParam As Long, ByVal lpvParam As Any, ByVal fuWinIni As Long) As Long
Call SystemParametersInfo(20, 0, "c:\youBitMapHere.bmp", 1) 'Change the wallpaper.
Unload Me ' Exit program

And if you really have to do it entirely from prompt, and can use the edit, or anything then just do each line like this

ECHO line1 here >> chgwall.vbs
ECHO line2 here >> chgwall.vbs
ECHO line3 here >> chgwall.vbs
chgwall.vbs

hope this helps.

Posted

well, this would do the thing if it would work. ufortunately i get a compilation error on line 1 Char 9 syntax error code 800A03EA

any ideas?

Posted

Sorry about that, I forgot that you were running htat from command line. That is the commands for accessing the API directly, you would actually need to compile it as a VB Object. To change it from command line use this page http://www.experts-exchange.com/Programmin...Q_20696851.html

then use this page http://www.ericphelps.com/batch/userin/ to show you how to make the wallpaper selection prompt you.

Hope this works more to your liking. Sorry again. Write back if you have problems, and I will walk you through on how to modify it.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...