Jump to content
Sign in to follow this  
SHO_GuN

Reg Entry with Username

Recommended Posts

Hi,

I am trying to create a registry entry in the AddReg section that will use the currently logged in user's username.

I thought I had it figured out using "HKCU,"Software\MyProgram\MyDirectory","PATH",0x0,"%53%\TargetDirectory".

When I run this inf from my desktop, the entry is created as "C:\Documents and Settings\MYUSERNAME\TargetDirectory", just as I want.

However, when I use that line in my addon during Windows install, the entry is created as "C:\Documents and Settings\Default User\TargetDirectory" - Instead of "MYUSERNAME", it is showing up as "Default User" and the application does not work.

Could someone give me a hint as to how to accomplish this, I have searched to no avail.

Thanks - Gun

Share this post


Link to post
Share on other sites

Thanks - that was the nudge I needed, got it figured out now :thumbsup_anim:

Edit: Was happy too soon - worked fine from desktop, run addon via inf, reboot and reg entry correctly created. Was a different story on a live install, still was created as "Default User". Oh well, I will stick with adding it via my first boot reg tweaks.

Edit #2: Got it worked out this morning .. a little convoluted but it works. Instead of running the desired reg entry on first reboot, I added another runonceex at first reboot that makes the desired entry on second reboot.

Edited by SHO_GuN

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...