How to manually edit/manage active desktop items

I would like to manage my Active Desktop items manually and primitively (e.g. using notepad or some other ). Can anyone tell me, please, how I can add an item to the Active Desktop **WITHOUT** using regedit, or Control Panel (including Desktop Properties/Active Desktop via right-clicking the desktop), or clicking 'Set as Desktop Item' in IE?
This is pretty much a challenge question. Points will NOT be given for anyone saying that it cannot be done!!

OS: Windows 2k Terminal
Active Desktop is enabled and one desktop item (a single JPG image) already exists and is visible/movable.
Desired: additional desktop item consisting of an HTML file that I have ready (call it C:\file.html)

I wanted to assign 750 points to this but they wouldn't let me so I don't mind adding points if the answer is contorted (read 'clever') enough!
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

You have to access the registry to set this, because the setting is at

HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Desktop\Components\

The only way to manipulate this using notepad would be to create a registry file and merge it into the registry by right-clicking it and choosing Merge. You'd still need to have read the registry to know which .\Components\ sub-key to create - 1, 2, 3, 4, and so on.

Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Desktop\Components\1]
"FriendlyName"="BBC NEWS | News Front Page"

Shell Script with Windows Scripting Host that writes to the registry.

In Javascript you'd do something like this:

var wshShell = WScript.CreateObject("WScript.Shell");
var regKey = "HKCU\Software\Microsoft\Internet Explorer\Desktop\Components\1\";
wshShell.RegWrite("Source", "");
.... etc

but you can't write more than one double-word to a REG_BINARY value so you'd not be able to write "Position", "OriginalStateInfo" or "RestoredStateInfo".

Why would you want to do this anyhow? Are you trying to hijack someone's PC? ;-p

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
aleemjumaAuthor Commented:
VBScript! Why didn't I think of that!!

Wait.  Don't answer that...   :)

No I'm not trying to hijack someone's PC - I'm just trying to reinstate a desktop item that I had, but I don't have access to regedit.exe.

OK. So I need StdRegProv to read/write REG_BINARY values to the registry - that's the GetBinaryValue and SetBinaryValue methods - correct?

so this should echo 0 and leave aValue(x) initialised with the xth hex value...

Dim Key, SubKey, Value, aValue(24)
Key = &H80000001 'HKCU
SubKey = "HKCU\Software\Microsoft\Internet Explorer\Desktop\Components\1\"
Value = "RestoredStateInfo"
WScript.Echo oReg.GetBinaryValue(Key,SubKey,Value,aValue)

so why does this echo 2 and leave aValue(x) set to Null?
i tried looking up what error code 2 means but couldn't find it - is there some translation necessary between the '2' and a normal 0x800... error code?

aleemjumaAuthor Commented:
normal vbscript access to the registry worked, by the way, so i can nicely set the rest of the stuff, just the binary values for which i need stdregprov...
Cloud Class® Course: MCSA MCSE Windows Server 2012

This course teaches how to install and configure Windows Server 2012 R2.  It is the first step on your path to becoming a Microsoft Certified Solutions Expert (MCSE).

The problem with the code example you've quoted is you could blindly over-write the \1\ subkey.

The result might be null because key \1\ doesn't exist.

 If you want it well-behaved you have to enumerate the existing sub-keys first and then use the next available index number.

The error you get is, I think, this:

    Object could not be found.
aleemjumaAuthor Commented:
it wasn't cos the \1\ key doesn't exist - i still had "HKCU" in the key string! [doh!]

managed to get another desktop item activated but it's appearing as a transparent box with a cross in the top corner (indicating it can't find the file i guess) but when i click the triangle menu at the top and select 'open in new window' the right file displays in iexplore fine. can anyone shed any light on this?

could it be to do with the flags or state values?

let me know if you need current values of flags and states and i'll post them up on mon/tues (am at a different computer at the mo...)


aleemjumaAuthor Commented:
I haven't had time to work on this enough lately so I think I'll just close the question but first here's where I'm at:

I have managed to get the items on the screen, but only partially. The correct file is being refereced for the item content but the content is not being displayed.

I'm sure it can be done with VBScript, as TJworld suggested (so points to TJworld), but I can't seem to make it work fully. If anyone can I'd appreciate a comment on this thread and/or a reference to the solution.


It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Fonts Typography

From novice to tech pro — start learning today.