Copy registry Value to another Key
Hi,
I have a package which (for licensing issues) needs to know the username who installed the app on the machine and place it in:
\\HKLM\Software\Eutech Technology\PEL\6\Name.
When the MSI is installed, I thought instead of prompting the User to enter User Name, I would just use a script to retrieve the user name logged on from:
\\HKCU\Software\Microsoft\Windows\Current Version\Explorer\Logon User Name.
And then put the value in:
\\HKLM\Software\Eutech Technology\PEL\6\Name.
Does anyone have a script that would do this?
Many thanks,
Mike.
I have a package which (for licensing issues) needs to know the username who installed the app on the machine and place it in:
\\HKLM\Software\Eutech Technology\PEL\6\Name.
When the MSI is installed, I thought instead of prompting the User to enter User Name, I would just use a script to retrieve the user name logged on from:
\\HKCU\Software\Microsoft\Windows\Current Version\Explorer\Logon User Name.
And then put the value in:
\\HKLM\Software\Eutech Technology\PEL\6\Name.
Does anyone have a script that would do this?
Many thanks,
Mike.
0 Comments
[ + ] Show comments
Answers (3)
Please log in to answer
Posted by:
Meic
17 years ago
I've managed to sort this out I think. If anyone is interested, here is the script:
Dim WshShell
Set WshShell = WScript.CreateObject("WScript.Shell")
vData = WshShell.RegRead("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Logon User Name")
WshShell. RegWrite"HKLM\SOFTWARE\Eutech Technology\PEL\6\Name", vData, "REG_SZ"
Cheers,
Mike.
Dim WshShell
Set WshShell = WScript.CreateObject("WScript.Shell")
vData = WshShell.RegRead("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Logon User Name")
WshShell. RegWrite"HKLM\SOFTWARE\Eutech Technology\PEL\6\Name", vData, "REG_SZ"
Cheers,
Mike.
Posted by:
anonymous_9363
17 years ago
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
so that the conversation will remain readable.