Question

Locked

need help regarding vbs scripting

By nxsubbeh ·
Really need some help here .. i would like to ask that whether is it possible to auto create the following registry(pc name) using vbs script is like something
PC NAME:nxsubbeh1
PC NAME:nxsubbeh2
and so on
cause currently im using the *IF* and *THEN*
and i need the registry in the same folder wit it too ..
[
strUserIn = InputBox("PC NUMBER")
set oShell = CreateObject("WScript.Shell")
if strUserIn = 1 then
oShell.run"regedit /s 1.reg"
elseif strUserIn = 2 then
oShell.run"regedit /s 2.reg"
elseif strUserIn = 3 then
oShell.run"regedit /s 3.reg"
end if
]

[
Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\ComputerName]

[HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\ComputerName\ComputerName]
"ComputerName"="nxsubbeh"
]

is it possible by using the vbs script i can auto create the registry.. PLEASE REALLY NEED HELP.. THANKS..

This conversation is currently closed to new comments.

1 total post (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Answers

Collapse -

A word or two of advice

by neilb@uk In reply to need help regarding vbs s ...

You would be better off making changes to CurrentControlSet. Although this is generally a pointer to ControlSet001, this is not ALWAYS the case!

However, changing the name of a standalone PC programmatically is pretty easy but I can't really see why you'd want to. Changing it for a Domain workstation is another matter entirely as you would need to remove it from the Domain, change the name and put it back and I'd even recommend as quick SID change as well!

What do you actually want to achieve?

Neil :)

Back to Windows Forum
1 total post (Page 1 of 1)  

Related Forums