Patrick de Gelder
asked on
How to create a registry Subkey containing the hostname
I am in need of some assistance by creating a script that creates a subkey in the registry that contains the hostname:
example:
[HKLM\Software\Greening\FM P@'hostnam e']
The hostname needs to be replace by the computer name
Something like in the following steps
- Detect hostname
- Set hostname
- Create registry sub-key.
example:
[HKLM\Software\Greening\FM
The hostname needs to be replace by the computer name
Something like in the following steps
- Detect hostname
- Set hostname
- Create registry sub-key.
ASKER
Thanks it seems to do the trick...
Well applied this yesterday on another system and kept generated an error on me.
Well applied this yesterday on another system and kept generated an error on me.
It needs to be started from an elevated prompt, otherwise you'll get an "Access Denied" because you're writing to HKLM.
ASKER
C:\Users\firstcare\Desktop >reg.exe add "HKLM\WOW6432Node\HSB Cards & Card Systems\NHIS-HP\Sources\HP Verificati on\HPVerif ication@DE SKTOP-GFN7 MF9"
ERROR: The parameter is incorrect.
This is the error i got
ERROR: The parameter is incorrect.
This is the error i got
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Stupid mistake glade you help me checking the code
ASKER
Thanks good one
Open in new window