/build/static/layout/Breadcrumb_cap_w.png

Using %USERNAME in a registry key WPS

I have a package that contains 1st run settings for an app. I have this app configured to use active setup and it will write a ton of registry entries for each user. There is one part of the registry that is named for the username i.e. HKCU\SOFTWARE\BOBSMITH\VALUES - I set it up in WPS to use the value [%USERNAME] so it pulls the username from the env variables. This seems to work fine and dandy. When I push this out through GPO, it seems that this key is trying to be created and is giving me a error 1402

Error 1402. Could not open key: HKEY_CURRENT_USER\Software\Hummingbird\PowerDOCS\Core\Plugins\Fusion\Settings\REDList\\HOWARDBH.

Right after REDList is where the username should appear but doesn't.

There is also mention of a permission issue in the event log.
System error 87. Verify that you have sufficient access to that key, or contact your support personnel.

Obviously if I execute manually while I am logged on, everything is fine. I took this one key out and everything works fine. What is happening to cause this and how can I correct it?

Jimm

0 Comments   [ + ] Show comments

Answers (10)

Posted by: rmroshan 14 years ago
Senior Yellow Belt
0
[%USERNAME]

Can you just try using [USERNAME] instead of [%USERNAME] in the registry and see if it works
Posted by: anonymous_9363 14 years ago
Red Belt
0
That won't work unless there is a property called USERNAME. You are probably thinking of the LOGONUSER property. Try that instead.
Posted by: JimmPanik 14 years ago
Orange Belt
0
Wise doesn't seem to like that at all. Any other ideas?

Jimm
Posted by: captain_planet 14 years ago
Black Belt
0
'LogonUser' is case-sensitive I believe. The 'Key' column in your Registry table should look like this:

Software\Hummingbird\PowerDOCS\Core\Plugins\Fusion\Settings\REDList\[LogonUser]\HOWARDBH
Posted by: anonymous_9363 14 years ago
Red Belt
0
Good catch, Cap'n, thank you.
Posted by: McRip 14 years ago
Orange Senior Belt
0
[LogonUser] is right. Does work with my script, too.

Cheers
Posted by: JimmPanik 14 years ago
Orange Belt
0
right. Does work with my script, too.

Still testing here.... but it looks good.

Jimm
Posted by: davidkevanian 14 years ago
Senior Yellow Belt
0
If you're still having problems, here's something else to consider. If the GPO is deployed at machine startup rather than at user logon, then there's no current user at this point. The installation will have completed prior to any user logging in. So the installation is trying to access a registry hive (HKCU) and an environment variable (USERNAME) that haven't been defined yet. That's also why the package works perfectly well when you run it while logged in, there exists at this point a Current User with an HKCU registry hive and a defined USERNAME environment variable.
Posted by: JimmPanik 14 years ago
Orange Belt
0
Worked perfectly. Thanks for the assistance. Any ideas why %USERNAME worked originally then stopped? I ran it that way in my testing probably a dozen times.
Posted by: cygan 14 years ago
Fifth Degree Brown Belt
0
Any ideas why %USERNAME worked originally then stopped?

you mean %USERNAME% as a property not %USERNAME
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ