Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

InvokeVerb Argh!! Make new verb

10 views
Skip to first unread message

John Smith

unread,
Aug 30, 2002, 6:35:39 AM8/30/02
to
I am trying to write a script to change my wallpaper.
I just spent two hours researching and testing the FolderItem Invoke verb
method
Cause when you right click a .BMP (under WinXP) there is "Set as Desktop
Background"
But....
It's not a verb!
I can't find it in the registry!

So can I make (or add) a verb for a file type in the registry?
If so, how would I do this set as wallpaper thing?
or
Must I resort to AutoIt to take be into Display Properties and press all the
buttons?

Here is my script, so you can see what I'm doing...

Set oApp = CreateObject("Shell.Application")
Set MyFolderItem = oApp.NameSpace("C:\Pictures").Items.Item("RealCool.bmp")

For Each MyVerb In MyFolderItem.Verbs
MyMsg = MyMsg & MyVerb.Name & vbNewline
Next
msgbox MyMsg

MyFolderItem.InvokeVerb "Pre&view"
MyFolderItem.InvokeVerb "Set As Desktop &Background"

msgbox "Script Finished"


spag

unread,
Aug 30, 2002, 7:58:12 AM8/30/02
to

"John Smith" <spamfree@don'tbother.com> wrote in message
news:eYUrcDBUCHA.1668@tkmsftngp13...

> I am trying to write a script to change my wallpaper.

It's easy... just use the RegWrite method like so...

Set WShell = WScript.CreateObject("WScript.Shell")
WShell.RegWrite "HKCU\Software\microsoft\Internet
Explorer\Desktop\General\Wallpaper", "%SystemRoot%\Web\Wallpaper\bliss.bmp",
"REG_EXPAND_SZ"

Then you just have to refresh the desktop. In Windows 9x that would be:

WShell.run"C:\WINDOWS\RUNDLL.EXE user,RepaintScreen"

In XP/2k you can try:

Set WApp = CreateObject("Shell.Application")
WApp.Namespace(0).Self.InvokeVerb "Refresh"


John Smith

unread,
Aug 30, 2002, 4:20:42 PM8/30/02
to
...and one mountain climber climbs up the north face, while the other simply
uses the ski lift...
I could kick myself!
Thank you very much

"spag" <spaghetti at aspyre dot net> wrote in message
news:uGyldxBUCHA.1676@tkmsftngp12...

0 new messages