| | |
I want to manipulate the registry key values through a vb.net application
Please support our VB.NET advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Mar 2005
Posts: 4
Reputation:
Solved Threads: 0
hello every one.
i would like to tell you that i am real biggener so please reply accordingly. any kind of help would be appriciated. i was trying to clean a specific registry key's value through my application.
i have added a button now i want that on click event of that button that particular registry entry's value is cleaned.
what i want to do is to increase the typed URL history through my application.
i was told to use a namespace microsoft.win32 but i dont even know how to use the namespace.
i would like someone to guide me through.
the registry key is
HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\TypedURLs
anyone can please help with this one and rest i'll do on the same traks.
Best Regards
Mohit
i would like to tell you that i am real biggener so please reply accordingly. any kind of help would be appriciated. i was trying to clean a specific registry key's value through my application.
i have added a button now i want that on click event of that button that particular registry entry's value is cleaned.
what i want to do is to increase the typed URL history through my application.
i was told to use a namespace microsoft.win32 but i dont even know how to use the namespace.
i would like someone to guide me through.
the registry key is
HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\TypedURLs
anyone can please help with this one and rest i'll do on the same traks.
Best Regards
Mohit
I'm not sure what you mean by "clean" the registry key, but it's all too easy to write to the registry like this:
That will effectively replace the value in url1 to http://www.google.com. The most difficult Part of this will be to figure out how many url values are available. Here is a peice of code that will loop through all the registry values (urls) in that registry key, and replace them with "" (nothing).
Now, IE Still recognizes these "" values, because the values are still in the registry, but URL's have been removed. They could have been changed just as easily to say, http://www.google.com. The way to actually Remove All The Values is as such:
Let me know if this helps you any
VB.NET Syntax (Toggle Plain Text)
dim WSH set WSH = createobject("WScript.Shell") WSH.RegWrite "HKCU\Software\Microsoft\Internet Explorer\TypedURLs\url1", "http://www.google.com"
That will effectively replace the value in url1 to http://www.google.com. The most difficult Part of this will be to figure out how many url values are available. Here is a peice of code that will loop through all the registry values (urls) in that registry key, and replace them with "" (nothing).
VB.NET Syntax (Toggle Plain Text)
' /* Create Shell Object */ dim WSH set WSH = createobject("WScript.Shell") ' /* Set I To 1 I = 1 ' / * Loop Without Conditions (Infinately) */ do ' /* If There is any kind of error, just keep processing */ on error resume next ' /* Read The String Value In The Registry Into the url Variable */ url = WSH.RegRead("HKCU\Software\Microsoft\Internet Explorer\TypedURLs\url" & I) ' /* If The Length Of What We Read From The Registry is 0, Then Break From The Loop */ if len(url) = 0 then exit do ' /* OverWrite The Current Value (current URL) with "" chr(34) is the character code for " */ WSH.RegWrite "HKCU\Software\Microsoft\Internet Explorer\TypedURLs\url" & I, chr(34) & "" & chr(34) ' /* Reset URL */ url = "" ' /* Add One To I (To get the next URL in the registry */ I = I + 1 loop ' /* All Done */ msgbox "Complete!" WScript.Quit
Now, IE Still recognizes these "" values, because the values are still in the registry, but URL's have been removed. They could have been changed just as easily to say, http://www.google.com. The way to actually Remove All The Values is as such:
VB.NET Syntax (Toggle Plain Text)
' /* Create Shell Object */ dim WSH set WSH = createobject("WScript.Shell") ' /* Set I To 1 I = 1 ' / * Loop Without Conditions (Infinately) */ do ' /* If There is any kind of error, just keep processing */ on error resume next ' /* Read The String Value In The Registry Into the url Variable */ url = WSH.RegRead("HKCU\Software\Microsoft\Internet Explorer\TypedURLs\url" & I) ' /* If The Length Of What We Read From The Registry is 0, Then Break From The Loop */ if len(url) = 0 then exit do ' /* Delete The URL From The Registry */ WSH.RegDelete "HKCU\Software\Microsoft\Internet Explorer\TypedURLs\url" & I ' /* Reset URL */ url = "" ' /* Add One To I (To get the next URL in the registry */ I = I + 1 loop ' /* All Done */ msgbox "Complete!" WScript.Quit
Let me know if this helps you any
•
•
Join Date: Mar 2005
Posts: 4
Reputation:
Solved Threads: 0
This really helped me a lot. thanks a lot.
now what i am focusing towards is that user gets an option to alter a registry key's value when he clicks at a link label. he gets a window displayed in front of him where the value fo the key is written. he can alter the value there and it gets altered back in the registry.
i know this is a bit smart to do but i think me on this website!!!! it is possible when you get good programers like the one who replied to me for the first time.
what i am trying to do is preety much simmlar to browser hijac restore of MS Anti Spyware.
Regards
Mohit
now what i am focusing towards is that user gets an option to alter a registry key's value when he clicks at a link label. he gets a window displayed in front of him where the value fo the key is written. he can alter the value there and it gets altered back in the registry.
i know this is a bit smart to do but i think me on this website!!!! it is possible when you get good programers like the one who replied to me for the first time.
what i am trying to do is preety much simmlar to browser hijac restore of MS Anti Spyware.
Regards
Mohit
•
•
Join Date: Mar 2005
Posts: 4
Reputation:
Solved Threads: 0
the key in questions is
HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main
and i want to alter the Key Value from the app directly fot he start page URL.
the key can be chaged if it is set to a particular one in button event handler butthe part of providig the user to put a value of his choice in the app and then pressing a button to replace is the diff part i think.
lets see if i have any luck eith the coders here
HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main
and i want to alter the Key Value from the app directly fot he start page URL.
the key can be chaged if it is set to a particular one in button event handler butthe part of providig the user to put a value of his choice in the app and then pressing a button to replace is the diff part i think.
lets see if i have any luck eith the coders here
VB.NET Syntax (Toggle Plain Text)
' /* Create Shell Object */ dim newurl dim WSH set WSH = createobject("WScript.Shell") ' /* Get The URL From The User */ newurl = inputbox("Please, Enter The New Home Page") ' /* If They Hit Cancel, Or Leave It Blank Then Exit Sub */ if newurl = "" then exit sub ' /* Set The Home Page To The New URL */ wsh.regwrite "HKCU\Software\Microsoft\Internet Explorer\Main\Start Page", newurl ' /* Tell us It's Done */ msgbox "Done!"
•
•
Join Date: Mar 2005
Posts: 4
Reputation:
Solved Threads: 0
If this keep on going like this is think that i would fall of my chair. this comasot is a real programer man. wish he was my teacher.
now since this prob have also been resolved i think now is the most appropriate time to deliever my new prob.
i want to make a friendly interface like BROWSER HIJACK RESTORE
now i want that several item like start page and search page directly come into a list view. when user clicks at it an inprutbox comes out asking for entry of the new URL or we ca set a default for every entry and when user clicks at restore all the defaults apply else user selects one click at change button and then the input box appears for changing the URl.
i think this is a real tedioud and time taking job.
i know i am asking for too much but this the way i would get to know. befor asking for help i always try to get things done by myself but i am a begineer so ti dont think i am capable of doing all this stuff.
one day when i become programer i would help others here at this exteemed website
now since this prob have also been resolved i think now is the most appropriate time to deliever my new prob.
i want to make a friendly interface like BROWSER HIJACK RESTORE
now i want that several item like start page and search page directly come into a list view. when user clicks at it an inprutbox comes out asking for entry of the new URL or we ca set a default for every entry and when user clicks at restore all the defaults apply else user selects one click at change button and then the input box appears for changing the URl.
i think this is a real tedioud and time taking job.
i know i am asking for too much but this the way i would get to know. befor asking for help i always try to get things done by myself but i am a begineer so ti dont think i am capable of doing all this stuff.
one day when i become programer i would help others here at this exteemed website
Hi Guys
I have managed to write values to a Windows Mobile CE Registry Editor from my application.
I have a writeIniReg() and a readIniReg() function
So, when the user enters their name in the textbox on the form it is written to the registry and read from it again the next time the user runs the program.
But my problem is that my readIniReg() gets a NullReferenceException when the program first loads .... but if I comment out the readIniReg() and run it to write data to the registry then uncomment the code, it can read from it...
Can anyone help me to check in my readIniReg() if the subKey folders exist first and create them if they dont exist ... so that I can get away from my error message.
Please even give some suggestions ... I still have a lot to learn with VB
Regards
Elmo
I have managed to write values to a Windows Mobile CE Registry Editor from my application.
I have a writeIniReg() and a readIniReg() function
So, when the user enters their name in the textbox on the form it is written to the registry and read from it again the next time the user runs the program.
But my problem is that my readIniReg() gets a NullReferenceException when the program first loads .... but if I comment out the readIniReg() and run it to write data to the registry then uncomment the code, it can read from it...
Can anyone help me to check in my readIniReg() if the subKey folders exist first and create them if they dont exist ... so that I can get away from my error message.
Please even give some suggestions ... I still have a lot to learn with VB

VB.NET Syntax (Toggle Plain Text)
Public Function readIniReg() As Boolean Dim localResult As Boolean Dim regKey As RegistryKey Dim regKeyCompany As RegistryKey Dim regKeyProduct As RegistryKey localResult = False regKey = Registry.CurrentUser.OpenSubKey("Software", True) regKeyCompany = regKey.OpenSubKey("Company", True) regKeyProduct = regKeyCompany.OpenSubKey("Data", True) 'Name of value to return strName = regKeyProduct.GetValue("Username").ToString() 'Pass username string variable to form1 variable Form1_LogIn.username = strName 'Display Name in the textbox Form1_LogIn.txt_user.Text = strName 'Close all keys regKeyCompany.Close() regKeyProduct.Close() regKey.Close()
Regards
Elmo
Michelle (Junior Developer)
•
•
Join Date: Apr 2009
Posts: 1
Reputation:
Solved Threads: 0
i want to add button on each google result search usig vb.net can any budy help me ou
0
#9 Apr 5th, 2009
![]() |
Similar Threads
- about registry key . . . (Visual Basic 4 / 5 / 6)
- Prevent a registry key from deletion (C#)
Other Threads in the VB.NET Forum
- Previous Thread: Problem with Picture Box resizing
- Next Thread: Update query not working in VB.NET
| Thread Tools | Search this Thread |
.net .net2008 30minutes 2005 2008 access account arithmetic array basic bing button buttons center check code combobox component connectionstring crystalreport data database databasesearch datagrid datagridview date design dissertation dissertations dropdownlist excel fade file-dialog filter folder ftp generatetags google gridview hardcopy images input insert intel internet mobile monitor ms net networking objects output panel passingparameters peertopeervideostreaming picturebox picturebox1 port position print printing problem problemwithinstallation project save searchbox searchvb.net select serial shutdown soap survey table tcp temperature text textbox timer timespan toolbox trim update updown user vb vb.net vb.netcode vb.netformclosing()eventpictureboxmessagebox vb2008 vbnet view visual visualbasic visualbasic.net visualstudio visualstudio2008 web winforms wpf year






