Highlighted
Absent Member.. Absent Member..
Absent Member..
869 views

Changing windows registry values for HKCU or HKLM through VuGen scripts?

Does anyone has any experience changing registry entries on windows through VuGen scripts that works successfully on load generators through PC 12.53 ?

What loadrunner functions useful to do the same ? I would prefer http protocol with just c functions that would be most performant.

 

Thanks!

Sanjay

0 Likes
2 Replies
Highlighted
Acclaimed Contributor.
Acclaimed Contributor.

Re: Changing windows registry values for HKCU or HKLM through VuGen scripts?

Hi,

Never tried it myself...

Can you try the suggested solution in this post? http://stackoverflow.com/questions/26194535/changing-registry-values-in-c

Regards,

Shlomi

 

0 Likes
Highlighted
Acclaimed Contributor.
Acclaimed Contributor.

Re: Changing windows registry values for HKCU or HKLM through VuGen scripts?

Hi

As Shlomi said there are no native LoadRunner functions to use.

We have also the need of ensuring registry values, and have used advapi32.dll sucessfully.

It will need some programming skills to get working, but should not be impossible if you are a programmer.

Sample code, that would need some extra errorchecking:

const unsigned long HKEY_CLASSES_ROOT = 0x80000000;
const unsigned long HKEY_LOCAL_MACHINE = 0x80000002;

int set_reg(){ long m_lngRetVal; long lngKeyHandle; // Load DLL to access the registry lr_load_dll("advapi32.dll"); // get handle to key m_lngRetVal = RegCreateKeyA(HKEY_LOCAL_MACHINE, "SOFTWARE\\MyCompany\\Test\\", &lngKeyHandle); // write value m_lngRetVal = RegSetValueExA(lngKeyHandle, "Test_Value", 0, REG_SZ, "0", 1); // close handle m_lngRetVal = RegCloseKey(lngKeyHandle); return 1; }
.
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.