473,785 Members | 2,419 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Write to Vista Registry

4 New Member
G'Day,
I've been trying to find an answer to this for a long time now and haven't been making any headway. I have a maintenance application that runs a defrag, checkdisk, windows updates etc in VB.NET 2008 Express (.Net 3) and as a part of that the application is to reset the username so the user doesn't have to remember their particular username (you'd be surprised how many users don't know their username). This is even more of a problem in Vista as you need to know your domain name and remember to click the "Use Other Account" button.

At the end of maintenance, the application automatically writes the username and domain to the LastLoggedOn and LastLoggedOnSAM keys in the HKLM\Software\M icrosoft\Window s\Current Version\Authent ication\LogonUI part of the registry.

This works in Windows XP (funnily enough, no UAC) but not Vista. I'm using ClickOnce to deploy the application as it provides a handy deployment and update function. For some reason, there is no "Run As Administrator.. ." when you right-click on the application.

Is there any way to write this information or am I going to have to resort to restoring a .reg file with the values in it?

Thank You
Gareth
Dec 23 '08 #1
1 2652
OuTCasT
374 Contributor
I have no problem writing to registry and ive used vista ultimate and windows 7.
Expand|Select|Wrap|Line Numbers
  1. If TextBox1.Text = "blabla" Then
  2. Try
  3. Dim regKey As RegistryKey
  4. regKey = Registry.LocalMachine.OpenSubKey("registryPath", True)
  5. regKey.SetValue("NameOfEntry", TextBox1.Text)
  6. regKey.Close()
  7. MsgBox("Finish.")
  8. Application.Exit()
  9. Catch ex As Exception
  10. End Try
  11. Else
  12.  
Jan 29 '09 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

9
1950
by: BigAbility | last post by:
is there registry in Longhorn( vista) ? i heard about Registry will disappear in longhorn. is it true?
11
3580
by: vovan | last post by:
I'm using this approach to read from registry. Dim f As New RegistryPermission(RegistryPermissionAccess.AllAccess, _ "HKEY_LOCAL_MACHINE\SOFTWARE\SRS Enterprises\Coordinator\Settings") 'Vlad 02/12/2007 Dim f2 As New RegistryPermission(RegistryPermissionAccess.AllAccess, _ "HKEY_CURRENT_USER\Software\Classes\VirtualStore\MACHINE\SOFTWARE\SRS Enterprises\Coordinator\Settings")
5
3680
by: =?Utf-8?B?Qkw=?= | last post by:
Hello friends In c# 2005 I have written a function to access "font file name" by "Font name" and it is working fine in all the windows version other than vista, in vista it is throughing an error so please help me how can i access font file name by font name in windows vista or what change i have to do in following function to get the solution my function source code is givin below -
2
2094
by: =?Utf-8?B?QW5qYW5h?= | last post by:
Hello we creating a web application in ASP .net 2.0. we are trying to read font file path from registry as below Microsoft.Win32.RegistryKey registryKeyParen registryKeyChild = registryKeyParent.OpenSubKey(subKey); it's running in windows xp. but when we try to run this application in windows vista
3
3036
by: dianedebuda | last post by:
Using only Access 97. Need to run as admin in order to use Tool /Compact, etc. Tried Allen Browne's suggestion about registry hack meant for multiple versions of Access, but doesn't seem to work for "version 8.". (Still get Error 75: Path/File access error) Users have been using desktop icons pointing to specific .mdb. Although "Run as Administrator" is available for short-cut to msaccess.exe, it is grayed out when specific mdb is added...
3
5786
by: Rob Latour | last post by:
The following snippet (vb.net 2005) is working just fine in xp but not in vista in xp it lists all related sub keys in the registry just fine. in vista it doesn't list certain ones (like Unimodem) Dim rk As Microsoft.Win32.RegistryKey rk = My.Computer.Registry.LocalMachine.OpenSubKey("SOFTWARE\Microsoft\Windows\CurrentVersion") For Each SubKeyName As String In rk.GetSubKeyNames()
2
3185
by: =?Utf-8?B?UGV0ZQ==?= | last post by:
Hi, I have developed a VB application in VS2005 and deployed it sucessfully to XP using an MSI file built with a standard VS setup project. The MSI creates some keys under HKEY_LOCAL_MACHINE\Software. However when deploying to Vista, although the setup completes without error, the registry entries are not created. This occurs even when run by an administrator or when running the setup.exe using "Run As Administrator". I'm very new to...
2
2821
by: terryastone | last post by:
I have an application that reads some registry values stored in the Local Machine\Software\... key. In XP, I can see these values using RegEdit. In my application I can read the values at startup, and change the values during the application. In Vista, I CANNOT see the values using RegEdit but I can read the values using the application. I created some values using RegEdit in the place where my values would be. Now I can see them...
6
6681
by: sd | last post by:
hello I need to keep my app entry under HKEY_LOCAL_MACHINE\Software\MyApp. (to support for all users).I need to update one key under MYApp. When I attempt to set value for this key My.Computer.Registry.LocalMachine.CreateSubKey("software \MyApp").SetValue("Licence", "Success") I get error stating Access to HKEY_LOCAL_MACHINE\Software\MYapp denied for Vista only.For XP no problem.If for Vista I give full control to Myapp reg folder...
0
9647
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9489
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10357
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10162
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9959
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8988
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7509
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5396
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
3665
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.