registry

Change user authentication settings type from registry.

I already change the value of the registry (using a c# windows application) (HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Lockdown_Zones\1) "1A00" to "30000"(Hexa) equivalent to "Prompt for username and password ", and the change is done. but when i try to return the key value to the previous value "20000...

C++ read registry string value in char*

I'm reading a registry value like this: char mydata[2048]; DWORD dataLength = sizeof(mydata); DWORD dwType = REG_SZ; ..... open key, etc ReqQueryValueEx(hKey, keyName, 0, &dwType, (BYTE*)mydata, &dataLength); My problem is, that after this, mydata content looks like: [63, 00, 3A, 00, 5C, 00...], i.e. this looks like a unicode?!?!. I...

How to read registry correctly for multiple values in c?

Hi! I created a .dll which should work like the RunAs command. The only difference is, that it should read from registry. My problem is, that i need to reed 3 values from the registry, but i can't. It reads the first, than it fails at the second one (Password) with error code 2, which means "The system cannot find the file specified". I...

How to create a registry key in 64bit view from a 32bit application, using native Windows API

I'm kind of a noob when it comes to windows API. I try to create a registry key in the 64bit view of the registry, from a 32bit application using System::Call "${RegCreateKeyEx}(${HKEY_LOCAL_MACHINE}, 'SOFTWARE\SecureW2\Methods\Default\Profiles\26\ConfigData', 0, 'REG_BINARY', 0x00000000L, 0x0100, NULL, .r5, .r6) .r3" (It's nsis scr...

Is there a size limit on WritePrivateProfileStruct?

I'm trying to write an INI file using the WritePrivateProfileString and WritePrivateProfileStruct functions. I found that when the byte count is relatively low, WritePrivateProfileStruct and GetPrivateProfileStruct work fine, but with a higher byte count (62554 bytes in my case), the Write function seems to work but the Get function do...

Performance Counters Registry validation

I have a C# application that adds some performance counters when it starts up. But if the registry HKEY_LOCAL_MACHINE->SOFTWARE->Microsoft->Windows NT->CurrentVersion->Perflib is corrupted (missing or invalid data), the operation of checking the existence of the performance counters (PerformanceCounterCategory.Exists(category) takes a re...

Set system time into registry

i want to create a new registry entry and set current system time into registry. How can i implement it using C++ ...

Registry entry using VC++, Data corrupting

Hi I want to set system time to registry, i did like this. But some null characters only getting there. when i am giving LPCTSTR data = TEXT("24/3/2010\0"); LONG setRes = RegSetValueEx (hkey, value, 0, REG_SZ, (LPBYTE)data, 100)); thsi is sucessfully adding into registry How to trace the issue IF possible please check my code ...

PInvokeStackImbalance -- C# with offreg.dll ( windows ddk7 )

I am trying to create an offline registry in memory using the offreg.dll provided in the windows ddk 7 package. You can find out more information on the offreg.dll here: MSDN Currently, while attempted to create the hive using ORCreateHive, I receive the following error: "Managed Debugging Assistant 'PInvokeStackImbalance' has dete...

How to access GMT time using VC

In my project i am using GetLocalTime() and GetSystemTime and set the current time into registry. But my problem is when i am changing the time of my machine the changed time only saving to registry. Is there any chance to access the GMT time so that its independent of machine and nobody can change the time.. Please give some help ...

How do I pass credentials to a machine so I can use Microsoft.Win32.RegistryKey.OpenRemoteBaseKey() on it?

This .NET API works OK if I'm trying to open the Registry in a machine that's in the same domain as I am (and my logged-on user has admin rights on the target machine). It gets tricky if it's an out-of-domain machine with a different, local administrative user (of whom I do have the password). I tried to use WNetUseConnection() (which ...

Working with Windows registry using java.util.prefs.Preferences

Hi! I have some questions about the registry. We have Preferences p = Preferences.userRoot(); If we execute p.nodeExists("/HKEY_CURRENT_USER/Software/Policies/Microsoft") it will return true. After it: p = p.node("/HKEY_CURRENT_USER/Software/Policies"); for(String s : p.childrenNames()){ System.out.println(">" + s); ...

How do I get an unexpanded REG_EXPAND_SZ string from a remote registry?

I am currently using RegistryKey.GetValue(string name, object defaultValue, RegistryValueOptions options) with RegistryValueOptions.DoNotExpandEnvironmentNames for the options value. However, this is only valid when run on the local machine. Digging down via Reflector, I find it expands the strings locally. Which means that irrespecti...

How to create Item in right context menu for all extensions except .zip?

I need to create Item in right context menu for all files except .zip I thought that I'm able to use something like this: HKEY_CLASSES_ROOT\* and exclude only .zip somehow is there any solution for this? ...

Problem registering a COM server written for Excel registered on client machine (can't set full path to mscoree.dll)

In this previous question <How to get COM Server for Excel written in VB.NET installed and registered in Automation Servers list?> there is an example of how to create the full path to a registry key using VS 2008. Everything in the previous answer works correctly except the full path that I am setting (using the registry editor in VS) f...

Registry key editing vb6 startup

Is it possible that someone here could explain how to use this code. Please keep in mind i am a complete amateur, so simplifications may be needed. Private Const cPGM = "C:\VB Forum\startup\Example.exe" Dim oShell As IWshShell_Class Set oShell = New IWshShell_Class oShell.RegWrite "HKLM\Software\Microsoft\Windows\CurrentVersion\Run\My...

WMI: Editing the Registry Remotely

I'm trying to use the following code (poorly written, but it's just a proof of concept) to edit the registry of a computer on a domain. I have a domain account, and I've verified that the domain admin group is present in the local admin group on the machines I'm attempting to affect. I've connected to these other machines to perform ot...

How can I get the Name of the Program associated with a file extension using Delphi?

I need to get the name of the program currently associated with a file extension for the current user. If you right-click on a file and select properties, then what I need is the program name that is to the right of the "Opens with" line. e.g. For ".xls", I want to be able to get the answer "Microsoft Office Excel", or whatever program...

How to create file association with two program and making one default if both present?

I have to create file association for an extension with two programmes and if both programmes A and B are present then choose program A to open the file. If only B is present then choose program B to open the file. If you can give the wix code or else you can provide me with registry details. ...

Why aren't .NET "application settings" stored in the registry?

Some time back in the nineties, Microsoft introduced the Windows Registry. Applications could store settings in different hives. There were hives for application-wide and user-specific scopes, and these were placed in appropriate locations, so that roaming profiles worked correctly. In .NET 2.0 and up, we have this thing called Applicat...