I'm sorry. I typed that post in response to a different thread. I'm not sure how it ended up here, but I must have typed in the wrong box. My apologies for the lack of addressing the problem, and confusion!
Here is one thing you can do with gadgets. If you have a gadget set to start on startup, I think that's what we are talking about, and you want it to stop loading on startup whenever you close it from the bar. DesktopX sets a gadget to run on startup by putting a shortcut in the user's Startup folder.
[user](s)\Start Menu\Programs\Startup
You can delete this shortcut in a special close subroutine, and the widget/gadget won't start on the next reboot. When user clicks close button you set up, then you delete the shortcut and Widget.Close. If widget closes normally, leave shortcut there. You can create this shortcut, if it does not already exist, in the Object_OnScriptEnter to set it to run on the next startup.
Or, if you want the widget or group of DesktopX objects to run, and be available to the sidebar, but be hidden on startup, you can use a
Widget.Preference and set it to True or False. Then, in your Object_OnScriptEnter sub, you can check what it is, and set the self visibility Object.Visible = Widget.Preference("MyVisiblilityPref").Value
Sorry, again, for not making sense. I intended that response for someone else.
You can change registry settings with vbscript also.
ACtiveExperts.ComBut this will often cause anti-virus and such to go off.