| View previous topic :: View next topic |
| Author |
Message |
OSIRIS Grandmaster Cheater
Reputation: 0
Joined: 27 Aug 2006 Posts: 654
|
Posted: Tue Mar 11, 2008 10:34 pm Post subject: [HELP VB2008] How would I edit regedit |
|
|
How would I edit parts of the regedistry. For example I want to add this string
| Code: |
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run
|
and run C:\Windows\System32\program.exe
|
|
| Back to top |
|
 |
AndrewMan Grandmaster Cheater Supreme
Reputation: 0
Joined: 01 Aug 2007 Posts: 1257
|
Posted: Tue Mar 11, 2008 10:35 pm Post subject: |
|
|
Ahh I used to remember lemme think...
Ill get back to you tommororow night after school, gotta finish french HW than sleep.
_________________
|
|
| Back to top |
|
 |
OSIRIS Grandmaster Cheater
Reputation: 0
Joined: 27 Aug 2006 Posts: 654
|
Posted: Tue Mar 11, 2008 10:39 pm Post subject: |
|
|
| kk
|
|
| Back to top |
|
 |
hcavolsdsadgadsg I'm a spammer
Reputation: 26
Joined: 11 Jun 2007 Posts: 5801
|
|
| Back to top |
|
 |
OSIRIS Grandmaster Cheater
Reputation: 0
Joined: 27 Aug 2006 Posts: 654
|
Posted: Tue Mar 11, 2008 10:47 pm Post subject: |
|
|
I dont get it. What do I do with the code they give me.
| Code: |
Imports Microsoft.VisualBasic
Imports System
Imports System.Security.Permissions
Imports Microsoft.Win32
<Assembly: RegistryPermissionAttribute( _
SecurityAction.RequestMinimum, ViewAndModify := "HKEY_CURRENT_USER")>
Public Class RegKey
Shared Sub Main()
' Create a subkey named Test9999 under HKEY_CURRENT_USER.
Dim test9999 As RegistryKey = _
Registry.CurrentUser.CreateSubKey("Test9999")
' Create two subkeys under HKEY_CURRENT_USER\Test9999.
test9999.CreateSubKey("TestName").Close()
Dim testSettings As RegistryKey = _
test9999.CreateSubKey("TestSettings")
' Create data for the TestSettings subkey.
testSettings.SetValue("Language", "French")
testSettings.SetValue("Level", "Intermediate")
testSettings.SetValue("ID", 123)
testSettings.Close()
' Print the information from the Test9999 subkey.
Console.WriteLine("There are {0} subkeys under Test9999.", _
test9999.SubKeyCount.ToString())
For Each subKeyName As String In test9999.GetSubKeyNames()
Dim tempKey As RegistryKey = _
test9999.OpenSubKey(subKeyName)
Console.WriteLine(vbCrLf & "There are {0} values for " & _
"{1}.", tempKey.ValueCount.ToString(), tempKey.Name)
For Each valueName As String In tempKey.GetValueNames()
Console.WriteLine("{0,-8}: {1}", valueName, _
tempKey.GetValue(valueName).ToString())
Next
Next
' Delete the ID value.
testSettings = test9999.OpenSubKey("TestSettings", True)
testSettings.DeleteValue("id")
' Verify the deletion.
Console.WriteLine(CType(testSettings.GetValue( _
"id", "ID not found."), String))
testSettings.Close()
' Delete or close the new subkey.
Console.Write(vbCrLf & "Delete newly created " & _
"registry key? (Y/N) ")
If Char.ToUpper(Convert.ToChar(Console.Read())) = "Y"C Then
Registry.CurrentUser.DeleteSubKeyTree("Test9999")
Console.WriteLine(vbCrLf & "Registry key {0} deleted.", _
test9999.Name)
Else
Console.WriteLine(vbCrLf & "Registry key {0} closed.", _
test9999.ToString())
test9999.Close()
End If
End Sub
End Class
|
|
|
| Back to top |
|
 |
AndrewMan Grandmaster Cheater Supreme
Reputation: 0
Joined: 01 Aug 2007 Posts: 1257
|
Posted: Tue Mar 11, 2008 10:50 pm Post subject: |
|
|
First Declare these
| Code: | Visual Basic (Declaration)
<ComVisibleAttribute(True)> _
Public NotInheritable Class RegistryKey _
Inherits MarshalByRefObject _
Implements IDisposable |
Than copy and paste that huge code. Not sure where though. Try a button and than when you click that it will make a registry key.
_________________
|
|
| Back to top |
|
 |
sponge I'm a spammer
Reputation: 1
Joined: 07 Nov 2006 Posts: 6009
|
Posted: Tue Mar 11, 2008 11:36 pm Post subject: Re: [HELP VB2008] How would I edit regedit |
|
|
| mageknight wrote: | How would I edit parts of the regedistry. For example I want to add this string
| Code: |
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run
|
and run C:\Windows\System32\program.exe | Oh god.
Anyways... http://msdn2.microsoft.com/en-us/library/ms724880%28VS.85%29.aspx
_________________
|
|
| Back to top |
|
 |
Estx Expert Cheater
Reputation: 0
Joined: 04 Mar 2008 Posts: 172
|
Posted: Wed Mar 12, 2008 7:43 am Post subject: |
|
|
Use:
| Code: | | Microsoft.Win32.Registry.LocalMachine.OpenSubKey("Software\Microsoft\Windows\CurrentVersion\Run").SetValue("name", "c:\program.exe"); |
I can't remember if VB uses absolutes off by heart (been a while since I've used it) but if it does, just change the code to either:
| Code: | | Microsoft.Win32.Registry.LocalMachine.OpenSubKey(@"Software\Microsoft\Windows\CurrentVersion\Run").SetValue("name", @"c:\program.exe"); |
or
| Code: | | Microsoft.Win32.Registry.LocalMachine.OpenSubKey("Software\\Microsoft\\Windows\\CurrentVersion\\Run").SetValue("name", "c:\\program.exe"); |
That's all the code you should need.
Last edited by Estx on Wed Mar 12, 2008 8:22 am; edited 1 time in total |
|
| Back to top |
|
 |
Haxory' Grandmaster Cheater Supreme
Reputation: 92
Joined: 30 Jul 2007 Posts: 1900
|
Posted: Wed Mar 12, 2008 8:03 am Post subject: |
|
|
wrong title
[HELP VB2008] How would I edit regedit
you should use:
[HELP VB2008] How would I edit the registry
because regedit is made up of two parts
regedit
it simply means: registry edit
_________________
you and me baby ain't nothing but mammals so lets do it like they do on the discovery channel |
|
| Back to top |
|
 |
AndrewMan Grandmaster Cheater Supreme
Reputation: 0
Joined: 01 Aug 2007 Posts: 1257
|
Posted: Wed Mar 12, 2008 2:23 pm Post subject: |
|
|
| haxory' wrote: | wrong title
[HELP VB2008] How would I edit regedit
you should use:
[HELP VB2008] How would I edit the registry
because regedit is made up of two parts
regedit
it simply means: registry edit |
Thanks smart guy
_________________
|
|
| Back to top |
|
 |
|