Hi,
I have a question i'm trying to copy the PC name witch is located in (HKEY_LOCAL_MACHINESYSTEMCurrentControlSetControlComputerNameComputerName) to a different registry key (HKEY_LOCAL_MACHINESOFTWAREIOLANSphereStation) but i can't get it to work.
I thought is should work with the script posted below but is doesn't it gives no error.
Set WshShell = Wscript.CreateObject("Wscript.Shell")
'Read the value of DefaultUserName :
reg = WSHShell.RegRead ("HKEY_LOCAL_MACHINESYSTEMCurrentControlSetControlComputerNameComputerNameComputerName")
'Replace the value with "Id" :
WshShell.RegWrite ("HKEY_LOCAL_MACHINESOFTWAREIOLANSphereStation"), "Id" ,"REG_SZ"
'Data Types :
'REG_DWORD
'REG_BINARY
'REG_EXPAND_SZ
As you probable already noticed i havent got that mutch experience with VBS Scripting.
I hope you guys can help me out al little.
Software/Hardware used:
Windows Xp Sp3
ASKED:
December 9, 2009 3:10 PM
UPDATED:
December 18, 2009 12:48 AM
I can read, the information from the registry using…
reg query “HKLMSYSTEMCurrentControlSetControlComputerNameComputerName” /v “ComputerName”
and i can also simply add the information to the registry but i want to automate it (Run Once at system start up)
The reason i want to automate this is because i have to clone a lot of PC’s and each one uses its PC name to logon to our companies software, having to edit every PC’s registry to add this information to the registry consumes a lot of time.
So if anyone knows of a way to do this, your help would be greatly appreciated.
Is there any reason you cannot use the COMPUTERNAME environment variable?
It works TnX Pjb0222…