See code below:
' Create the variables needed
Dim WSHShell
Dim strRegKey
Dim strWallpaper
Dim strDesktop
' Create the Wscript Shell object
Set WSHShell = WScript.CreateObject("WScript.Shell")
' Define the wallpaper
strWallpaper = "%SystemRoot%\Web\Wallpaper\PRWeb.html"
strDesktop = WSHShell.SpecialFolders("Desktop")
' Create the wallpaper key
strRegKey = "HKEY_CURRENT_USER\"
strRegKey = strRegKey & "Software\"
strRegKey = strRegKey & "Microsoft\"
strRegKey = strRegKey & "Internet Explorer\"
strRegKey = strRegKey & "Desktop\"
strRegKey = strRegKey & "General\"
strRegKey = strRegKey & "Wallpaper"
' Write the key, type, and value
WSHShell.RegWrite strRegKey, strWallpaper, "REG_EXPAND_SZ"
' Refresh the desktop now.
WSHShell.AppActivate strDesktop
WSHShell.SendKeys "{F5}"
' Quit
Wscript.quit(0)
htt files or dektop embedded files are not
input/output event scriptable.
While you can set a local or remote path to your
"src" or "href" stuff, it will not behave along
a meta "refresh tag"
========
I suggest you to observe the MS examples.
If 60% don't work, don't use it.
---------------
why not use a "naked" hta with iframe
and all security attributes default or enabled
and this window set beautifully as documented.
"Nebulus" <pfried...@nebulus.org> wrote in message
news:4KacnTo_APM...@comcast.com...
http://www.systeminternals.com/ntw2k/source/regmon.shtml
and see what call chain activity is actually taking place.
======
"Nebulus" <pfried...@nebulus.org> wrote in message
news:4KacnTo_APM...@comcast.com...
[snipped]
"Nebulus" <pfried...@nebulus.org> wrote in message
news:4KacnTo_APM...@comcast.com...
> Hey all. I've got a vbscript that'll set an html page as the desktop
> background, and it *should* refresh the desktop to show the page. The
> problem is that it's able to set the background, but the desktop doesn't
> refresh correctly. The desktop refreshes, but the background doesn't. Is
> there a way to do this?
You're not getting focus on the desktop, so you can't refresh by sending F5.
The following works on Win2k and WinXp, and is the equivalent of
interactively right-clicking on the desktop and selecting "Refresh" from the
context menu.
The spelling, capitalization, and location of the ampersand in the string
must match exactly per the localized language version of Windows...
set shellApp = createobject("shell.application")
set desktop = shellApp.Namespace(0)
desktop.self.InvokeVerb "R&efresh"
credit: Michael Harris (MVP)
For other versions, Jean (JMST Belgium) came up with the ingenious solution
of writing and running an SCF file. The following is a cut and paste (a
splash of Belgian French, but I think you can pick it out).
---
A scripting solution should be to create and run a SCF file
to give focus to the desktop followed by
sending F5 with SendKeys :
'---8<---Raffraichir_Bureau.VBS---Couper-Ici---
scfBureau=Repertoire_Script&"Le_Bureau.scf"
CreateObject("Scripting.FileSystemObject")._
CreateTextFile(scfBureau,True)._
Write(_
"[Shell]"&VbNewLine&_
"Command=2"&VbNewLine&_
"[Taskbar]"&VbNewLine&_
"Command=ToggleDesktop"_
)
With CreateObject("WScript.Shell")
.Run """"&scfBureau&""""
Effacer_Fichier(scfBureau)
WScript.Sleep 100
.SendKeys "{F5}"
End With
Sub Effacer_Fichier(fichier)
With CreateObject("Scripting.FileSystemObject")
On Error Resume Next
While .FileExists(fichier)
.DeleteFile fichier,True
Wend
On Error GoTo 0
End With
End Sub
Function Repertoire_Script
With WScript
r=.ScriptFullName
r=Left(r,Len(r)-Len(.ScriptName))
End With
Repertoire_Script=r
End Function
'---8<---Raffraichir_Bureau.VBS---Couper-Ici---
---
Joe Earnest
I figured it out, so here's the code:
' Quit
Wscript.quit(0)
"name" <rlei...@tampabay.rr.com> wrote in message
news:%239jtti%23VDH...@TK2MSFTNGP09.phx.gbl...
strWallpaper = "%SystemRoot%\Web\Wallpaper\PRWeb.html"
strRegKey = "HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Desktop\General\Wallpaper"
With CreateObject("Wscript.Shell")
.RegWrite strRegKey, strWallpaper, "REG_EXPAND_SZ"
CreateObject("Shell.Application").ControlPanelItem cstr("desk.cpl")
do until .AppActivate ("Display Properties") : wsh.sleep 100 : Loop
.SendKeys "{Up}{Down}{Enter}"
End With
Gurgen
http://www.gurgensvbstuff.com
"Nebulus" <pfried...@nebulus.org> wrote in message news:WR-dnWG55sp...@comcast.com...