Log inUsernamePassword
Log me on automatically each visit    
Register
Register
Log in to check your private messages
Log in to check your private messages
Visual Basic Forum for Visual Basic Programmers VB Forum Index » Registry & File Input / Output

Post new topic   Reply to topic
Add Value to Registry
View previous topic :: View next topic  
Author Message
mccay_a
Newbie


Joined: 28 Jun 2005
Posts: 1

PostPosted: Jun 28th, 2005 05:36 AM    Post subject: Add Value to Registry Reply with quote

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
View user's profile Send private message
vbman995
Moderator


Joined: 19 Aug 2005
Posts: 264
Location: Planet Earth

PostPosted: Aug 20th, 2005 02:41 PM    Post subject: Reply with quote

Try looking for source code that is related to registery at Planet Source Code. planet-source-code.com
Back to top
View user's profile Send private message
VB_Developer
Newbie


Joined: 25 Feb 2006
Posts: 18
Location: Hyderabad, India

PostPosted: Feb 27th, 2006 03:12 AM    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Visual Basic Forum for Visual Basic Programmers VB Forum Index » Registry & File Input / Output All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
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


Visual Basic Forum runs phpBB | Forum Template © iOptional
VB Resources | SSL | Visual Basic