473,396 Members | 1,834 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

REG_EXPAND_SZ

Is there a way in VB.NET to work with this type of registry key? One of our
software providers uses this for a directory entry. There installer that
creates the entry when a user runs is is very buggy. I am working on a .NET
app that can create the necessarry registry keys and files needed for a user
to run a program. I am not sure how to read and write values using
REG_EXPAND_SZ. Thank in advance for any help with this one.
Oct 17 '05 #1
4 4479
Hi nt32msngns,

Thanks for your post.

I am not sure I understand you very well. Can you explain your request in
more details? Normally, when we write an expandable environment variable
into the registry, it will not be expanded. For example, the code snippet
below will write the string "%path%" into the registry:
RegistryKey test9999 =
Registry.CurrentUser.CreateSubKey("Test9999");
test9999.SetValue("expandable string", "%PATH%");

If your request is how to write an expandable string into the registry or
is how to read %path% into the actual file system path, I think we can use
Environment.ExpandEnvironmentVariables to get this done. Something like
this:
RegistryKey test9999 =
Registry.CurrentUser.CreateSubKey("Test9999");
test9999.SetValue("expandable string",
Environment.ExpandEnvironmentVariables("%PATH%"));

Hope this helps.
If I misunderstand you, please feel free to tell me. Thanks

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

Oct 18 '05 #2
Hi nt32msngns,

Does my reply make sense to you? If you still have any concern, please feel
free to tell me, thanks

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

Oct 21 '05 #3
Works for me...just what I was looking for... thanks :)

""Jeffrey Tan[MSFT]"" wrote:
Hi nt32msngns,

Does my reply make sense to you? If you still have any concern, please feel
free to tell me, thanks

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

Oct 23 '05 #4
It's my pleasure to help you

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

Oct 24 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Jester | last post by:
'This is the code i have so far: Private Declare Function RegCloseKey Lib "advapi32.dll" (ByVal hKey As _ Long) As Long Private Declare Function RegOpenKey Lib "advapi32.dll" Alias _...
4
by: Peter Kaptein | last post by:
I am building websites using Databases and COM for 3tier apps. Currently I have to tell my COM object where the database is located either 1) Hardcoded in the DLL 2) Via my ASP call How do...
1
by: Erick Bodine | last post by:
I am trying to set a new environment variable on a W2k machine with only partial success. The name("SSID") and value("ASIM") show up correctly in the registry and when I go to "System...
1
by: cwnewbe1 | last post by:
I would like to be able to add environment symbols to the Microsoft XP registry. I tried the example in the Python Cookbook by Orielly by running the script locally and it worked fine. Although I...
1
by: DC Gringo | last post by:
I have some code that writes log entries upon errors in an VB.NET web app. I can write the Message but in the log, preceding my message is the following: Description: The description for...
0
by: Frank Jones | last post by:
When I call RegistryKey.GetValue for a remote system, it returns a value that has been automatically expanded for me using the environment of the machine that is running the .Net application (as...
1
by: Asaf Ganot | last post by:
Hi, I'm looking for a way to retrieve the date type of a registry value using c#. Since I couldn't find a way to do it with 'Microsoft.Win32', I tried to use the good old API call 'RegEnumValue'...
4
by: Nick | last post by:
Is there a way in VB.NET to work with this type of registry key? One of our software providers uses this for a directory entry. There installer that creates the entry when a user runs is is very...
18
by: jonpfl | last post by:
All, Can I use WScript inside an ASP page to kick off another process and post back to the client while this other process is still running? The reason I want to do this is because we are...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...
0
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,...
0
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...
0
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...

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.