VS 2010 VB And Deleting From Registry

Dec 5, 2011

I have access to VS 2010 through work and I'm having a bit of a play. I'm trying to create a small program to show the installed software from GP and have the ability to delete a selected registry key from a list. Am using a checked list box and 2 buttons. Also have 2 labels on the form but just using them as a visual check as to what the string says.

The program starts alright and gives the list of installed software from Group Policy. I'm having the problem deleting the ticked item. Here is the code I'm using. I think the problem is when it comes to the .deletesubkey line and what I have entered. I want it to delete the selected item rather than have the specific key name entered.

Imports Microsoft.Win32

Public Class Form1

Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load

[CODE]...

View 2 Replies


ADVERTISEMENT

Deleting A Registry Value?

Apr 20, 2011

I have this code which should make my application start on startup or stop it from starting on startup depending on whether a checkbox is checked or not:

If MnuItemAutoStart.Checked = True Then
My.Settings.Startup = True
'This code all works fine, it creates the registry key like clockwork
Dim oReg As RegistryKey = Registry.LocalMachine

[code]....

I have tried running the program as administrator, using a different registry value, turning off all of my antivirus & firewalls and loads of other stuff. The strange thing is that I can delete the registry key in regedit, or any other program, it's just my program won't do it. It works on another program with exactly the same code (same startup code, different program).

View 3 Replies

Deleting Registry Key?

Feb 9, 2009

I have been looking for ages trying to find a way to delete a registry key in vb.net - This works: My.Computer.Registry.LocalMachine.DeleteSubKey

But my problem is that the key I want to delete has a different name on every computer. I.E. "KL Deployment Wrapper5444789417547544987"

I have played arround with: My.Computer.Registry.LocalMachine.GetSubKeyNames.Find

View 1 Replies

Deleting A Registry String Value?

Jun 30, 2009

I need to delete a registry string value.The registry string value that I'm trying to delete is:

HKEY_LOCAL_MACHINESoftwareMicrosoftMSDN SetupDefaultSet

I've tried googling for results, but none of the sample scrips I have located have done the trick.They all seem to throw a bunch of errors in Visual Basic 2008 Express Edition.

View 9 Replies

Creating And Deleting Registry Value On Install And Uninstall?

Dec 20, 2006

I have program that on first run will run after installed will setup a server connection. The next times the program is run it will not execute this code to setup the server as it was done in the first run.

I can't use clickOnce IsFirstRun as the customer doesn't want that used for installation.I am using MSI to create the setup. I right click setup / view / Registry. I create a key value, example "HKEY_CURRENT_USERSoftwareReality", "App", "Installed"I set the property AlwaysCreate = false, and DeleteAtUninstall = true.

My big question I don't want to create the key value when the application is first installed. Only delete it when uninstalled.My code for checking for the key value:

Code:If (My.Computer.Registry.GetValue("HKEY_CURRENT_USERSoftwareReality", "App", Nothing) <> "Installed") Then 'The program is running for the first time so create key value My.Computer.Registry.SetValue("HKEY_CURRENT_USERSoftwareRealitySolutions", "CodeRed", "Installed") 'Setup server for the fist time Else 'The key exists so go no need to setup the server'Do something else End If

The key value deletes on the uninstalled - which is what i want it to do. However, it always creates the key value when installed. i don't want it to do this. It should only create the key value in the code.Can any tell me, when setting up the registry in the setup project, is there a way to stop it from creating the key value when the program is installed.

View 4 Replies

File I/O And Registry :: Deleting Lines In A Sequential Text File?

Mar 22, 2009

I know that Deleting a specific line in a sequential text file is impossible but instead copy the needed lines and not copying the unneeded ones to an output file .. killing the old one and renaming the new one with the same.. I can't make this step...

That is my record file

Code:
Input #1, CustomerName, CustomerHomeAddress, CustomerBussAddress, CustomerTel1, CustomerMob1, CustomerID, DateRent, CarRegPin

Code:
"Josek Sam","68 West Land Street","149 Union of States","4524563","45635463","JOSKSAM1",#2009-03-02#,"MILANCGLZ2008"
"Josef Malm","142 Unions Street","64 Hamersters Street","452504","42542054","JOSFMALM2",#2009-03-06#,"MILANCGLZ2008"
"Dave Green","131 Oxford Street","96 BlueBane Route","452542452","43254345","DAVGRN3",#2009-03-07#,"MILANCGLZ2008"

I made a form that when you put your CustomerID in Text3 Box.. it access the records and make some calculations. now.. The customer will return the car.. Then his data should be deleted.. I want to know how to make that when I enter the CustomerID and press on the Command button .. It copies the other lines to a new output folder and doesn't copy these ... So it appears to be deleted using this way..

View 3 Replies

VS 2010 Deleting PictureBox

May 15, 2011

I'm making a game for a school class on Visual Basic 2010. (Space Invaders for the ones that are curious) Everything was going smoothly until I ran into a little problem.

[Code]....

View 5 Replies

VS 2010 Deleting PictureBox?

Aug 29, 2010

I'm making a game for a school class on Visual Basic 2010. (Space Invaders for the ones that are curious)Everything was going smoothly until I ran nto a little problem.I shoot the missile intended to kill monsters. I use ictureBox1.Width.IntersectWith(PictureBox2.Location) or something like that to know when they intersect.

View 5 Replies

VS 2010 : Deleting Records From Access?

Feb 28, 2012

I am making a program that takes Access records and moves them into MySQL then checks to be sure everything is right and deletes the moved records. But, for some reason my delete command isnt working....

Here is the

Dim deleteCommandF As New OleDbCommand
Dim deleteCommandE As New OleDbCommand
Dim deleteCommandO As New OleDbCommand

[code]....

Running the program now to get the exact error message, shouldnt be more than 5 minutes and I'll post it.It says my paremeters are wrong? deleteCommandE.ExecuteNonQuery()

View 12 Replies

VS 2010 Deleting Large Files?

Jul 6, 2010

I have a series of large files (4GB) that when I delete takes a very long time. This only occurs on a USB drive that I have attached to my PC. If I do the same thing on the internal drive the files delete quickly. It is as if the files are being overwritten before being deleted. I am looking for some guidance or other approaches.

View 5 Replies

VS 2010 Designer Keeps Deleting The Code?

Mar 11, 2012

i have several forms in my solution that have listview controls and each of those listview controls uses the ListViewColumnSorter class that's provided on MSDN. This class requires a few lines of code in the Form_InitializeComponent Method of the Designer.Problem is, each time something on the form is changed, even if it's just a property of one of the controls, the designer deletes the code that I have for the listviews and I have to go back in and add it again.

View 4 Replies

Deleting Data From Database Using Sql, Access 07 And VB 2010

Dec 6, 2011

Dim Conx As String
Dim DBx As String
Conx = "Provider=Microsoft.ACE.OLEDB.12.0; "

[Code]....

View 3 Replies

VS 2010 : Adding And Deleting Records In The Database?

Aug 8, 2011

I have records in my datagridview (from database(ms sql server 2008 r2)). What i want to do is to insert the records selected by my datagridview checkboxcolumn and IF POSSIBLE automatically delete a record if the records to be inserted are equal to the records inside the database. (Hoping you got what I want to say.) For example. I have an A,B,C(child) that is under XXX(parent) in my database and I'll be inserting the A,B(child) again but it will be under YYY(parent). The old record in XXX will be deleted except C. I just want a possible DELETE STATEMENT These are what I've done so Far :

Insertion of record to database
Try
connectionString = "Data Source=***;"
sql_connection = New SqlConnection(connectionString)

[code].....

View 7 Replies

VS 2010 Deleting Lines From Text File?

Dec 16, 2011

I have the following code to read a csv file and copy each line to another file as long as it does not contain certain strings, it seems to work a little but it leaves some lines in it shouldn't, and it's also taking lines out it shouldn't as if I keep running it again on each output file it eventually takes everything out!

Private Sub Strip_File()
Microsoft.VisualBasic.FileOpen(1, tFile.Text, OpenMode.Input, OpenAccess.Read)
Microsoft.VisualBasic.FileOpen(2, "C:AcmeIPPMaster.csv", OpenMode.Append, OpenAccess.ReadWrite)

[Code]....

View 4 Replies

VS 2010 Deleting Multiple Items In A Listbox?

Apr 23, 2012

basically i had this problem before which i fixed with this code!

'REMOVE TIME
If ListBox1.SelectedIndex <> -1 Then
Dim Box As MsgBoxResult = MsgBox("Are you sure you want to remove this time?", MsgBoxStyle.YesNo)

[Code]....

It worked perfectly, all ive done to my code since is change the way the listboc is loaded / saved, it now comes from a .txt in My Documents rather than the C drive.

It now only deleted the top value of the group selected int he listbox and not all of them as it did before.

View 5 Replies

VS 2010 Items On Form Are Gone After Deleting Data Source?

Mar 5, 2012

OK so I did a noob screw up, I was cleaning my application and delting unused data sources and unused data bindings. Now my form is blank! All code shows up for the form and all items still show in the mainFrm.Designer.VB

View 4 Replies

Get SQL Commands (adding, Updating, Deleting) To Work With A VB 2010 Database?

Feb 12, 2012

My project involves making a table database that displays student number, surname, first name, homeroom, and grade avg. Through SQL commands, there must be functions to add, update, delete, search by field, and save records to the database.I have already set the database up just fine and displayed it in a DataGridView. Through the DataGridView, I was able to go to the "Add Query" area, and I successfully made the queries necessary for searching by field. However, when I try to do anything other than a search using the query builder (ie start my SQL command with INSERT INTO or DELETE FROM), I ultimately get the message "Failed to get schema for this query"For example, this SQL code (to add an entry to the database) worked when I was in the Query Builder (and the entry that it made is still in the database), but when I finally tried to confirm it, I got the "Failed to get schema for this query" message.Being unable to add entries to the database this way, I tried to do it with textboxes on a form. Each textbox will have one of the fields, and at the click of a button, they would be put into the table. My code is below. I do not know what is wrong withit. When I run it, my fields do not appear on the DataGridView immediately, but I must run the program again to see it. The time after, the entry is gone. So I am not sure how exactly such entries are to be saved.

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Try

[code].....

View 1 Replies

VS 2010 : Deleting Files, Fonts From Resources, Playing Videos?

Jan 11, 2012

I am having a _ton_ of issues, and I am hoping some of you could clear it up...

1. OK So a while back someone showed me an example for fonts from resources, but I noticed if you close the window that it opens, The entire program shuts down... what can I do to fix it?Also, The fonts are not showing up on all computers, only this one....

2. I am trying to delete a image file, which the program downloads from the internet, and can change regularly, but when I try to delete it will not delete. It says its in use, and I cant figure out where.

3. I am trying to play videos using the following

vb
Private Declare Function mciSendString Lib "winmm.dll" Alias "mciSendStringA" (ByVal lpstrCommand As String, ByVal lpstrReturnString As String, ByVal uReturnLength As Integer, ByVal hwndCallback As Integer) As Integer
Const WS_CHILD As Integer = &H40000000

[code]....

Now, I have confirmed the files it is attempting to play are in fact valid video files. It refuses to play all but the last one.

View 3 Replies

Visual Studio 2010 :: Excel Deleting Multiple Columns At The Same Time?

Feb 25, 2011

I am trying to delete more than one column in my excel sheet.

For Each lvi In ListView1.Items
If lvi.Checked = True Then
arrayLetters = lvi.SubItems(1).Text & ":" & lvi.SubItems(1).Text & "," & arrayLetters

[code]....

View 2 Replies

Create A VS 2010 Registry Key?

Nov 23, 2009

I'm running Windows 7 and am trying to Create a sub key in the registry.I used that code with no problems before but now it will not create this key [code].....

View 3 Replies

VS 2010 - Registry Key Exists

Nov 3, 2011

I'm having a hard time determining if a registry exists or not.

This is what I'm trying:

CODE:

The registry key exists on my PC, so I'm having a hard time debugging it on another PC. When it threw the error, I commented out the last block of code to see if I was checking the key wrong or if it would throw the error just on the variable declaration.

Which is did. I get why it did. You can't .Open a key that doesn't exist. However, I looked it up and everyone is recommending that we do it this way. But this way doesn't exist.

View 2 Replies

VS 2010 Add A Value To The Registry For The Runonce Key?

May 25, 2012

I need to add a value to the registry for the runonce key but I keep getting this error:Argument not specified for parameter 'MainKey' of 'Public Function BungeRegValue(MainKey As Microsoft.Win32.RegistryKey, sKey As String, sKeyName As String, oNameValue As Object, RegType As Microsoft.Win32.RegistryValueKind) As Boolean'.Creating the Function is fine but I get the error when I try to add the function to a button click event

Public Function MyRegValue(ByVal MainKey As RegistryKey, ByVal sKey As String, ByVal sKeyName As String,
ByVal oNameValue As Object, ByVal RegType As RegistryValueKind) As Boolean
Try

[code].....

View 13 Replies

VS 2010 Delete Registry Value?

Dec 21, 2009

How can i delete a value in the registry? I have tried with this code i found:

My.Computer.Registry.LocalMachine.OpenSubKey("HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionRun").DeleteValue("MyValue")

But it throws an Object not Set to an Instance Error.

View 5 Replies

VS 2010 Get The Value Of A Dword From The Registry?

Jul 18, 2011

I am unable to get a value from the registry, every time i run my code it returns a value of 'NoAutoRebootWithLoggedOnUser', even though the value should be 1.

[Code]...

View 7 Replies

VS 2010 Reading Registry Key?

Feb 8, 2011

I am trying to loop through a key to get all values. For some reason this returns nothing

Dim RegKey2 As RegistryKey = Registry.LocalMachine.OpenSubKey("SoftwareCompanyStartup")
Dim subname() = RegKey2.GetSubKeyNames
MsgBox(subname.Length)

[code].....

View 2 Replies

VS 2010 Registry Key Permissions?

Feb 19, 2010

im writing a program that edits Registry values using the

VB
Imports Microsoft.Win32
Imports System
Public Class Main

[Code]...

View 6 Replies

Read Remote Registry From VB 2010?

Jul 27, 2011

I created an in house tool in VB.net to complete my post installation steps of SQL Servers.

My tool completes all post installation steps like (Creating Database,storedporcedures,logins,logon trigger, database mail configuration, Jobs , local security policies and creating required folders and granting permissions to service account.)

[code]...

View 2 Replies

VS 2010 - How To Change Registry Key Permissions

May 5, 2012

I am trying to change the permisions of the following registry key from within VB.net:-
HKEY_LOCAL_MACHINESOFTWAREMicrosoftMSLicensing
Basically need to change users to full control. I need to change permissions for the "users" group.

View 8 Replies

VS 2010 - Protect Registry Key From Being Changed

Oct 5, 2010

When my program first launches, it generates a GUID which is then saved to the registry and compared to an online database when an internet connection is detected. If it is a valid registry key, another registry value is saved stating that it is valid. Is there a way to protect these 2 registry entries from being changed?

View 6 Replies

VS 2010 Alerted To Any Changes Made To The Registry?

Dec 28, 2011

Is there a way to be alerted to any changes made to the registry?

View 2 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved