 |
| View previous topic :: View next topic |
| Author |
Message |
mccay_a Newbie
Joined: 28 Jun 2005 Posts: 1
|
Posted: Jun 28th, 2005 05:36 AM Post subject: Add Value to Registry |
|
|
Hi People.
For something that should be so simple i cant find the help i require anywhere. And just for the record, yes i know basically nothing about vb.
Basically i am trying to create a basic vbscript in notepad which will allow me to enter values into the registry.
Has anyone got some sample code ( in the most basic format you can possibly come up with ) that will allow me to write Reg_string, Reg_SZ and DWORD values into the registry.
I have tried to use "readregistry" and editregistry" with no success, and also writereg seems to complicated to understand on some of the samples i have found.
CODE STRUCTURE :
If the registery key doesnt exist then write this registry key and this value
else if the registry does exist and has this value, change the value to "?"
From this i should be able to interprete the code structure
Any help would be appreciated.
Regards, Alan
Systems Engineer _________________ If it isn't broken, its not microsoft |
|
| Back to top |
|
vbman995 Moderator

Joined: 19 Aug 2005 Posts: 264 Location: Planet Earth
|
Posted: Aug 20th, 2005 02:41 PM Post subject: |
|
|
| Try looking for source code that is related to registery at Planet Source Code. planet-source-code.com |
|
| Back to top |
|
VB_Developer Newbie
Joined: 25 Feb 2006 Posts: 18 Location: Hyderabad, India
|
Posted: Feb 27th, 2006 03:12 AM Post subject: |
|
|
Hi,
You need to use Win APIs for this.
You can make use of GetSetting, SaveSetting and DeleteSetting
| Quote: |
GetSetting() : Returns a key setting value from an application's entry in the Windows registry.
SaveSetting() : Saves or creates an application entry in the application's entry in the Windows registry.
DeleteSetting() : Deletes a section or key setting from an application's entry in the Windows registry.
|
Here are some code, that can help you.....
| Code: |
GetSetting(appname := "MyApp", section := "Startup", _
key := "Left", default := "25")
SaveSetting appname := "MyApp", section := "Startup", _
key := "Top", setting := 75
SaveSetting "MyApp","Startup", "Left", 50
DeleteSetting "MyApp", "Startup"
|
Thanks
Deepak |
|
| Back to top |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|