Good Afternoon,
Is there a way to read from two separate text files (or one) and have them populate "sOldCname" and "sNewCname". Then run WSHShell.Run in a "For Each In"?
Currently, I have a InputBox for "sOldCname" and "sNewCname" but, I don’t want to input for over 800 workstations.
Any help would be appreciated?
Is there a way to read from two separate text files (or one) and have them populate "sOldCname" and "sNewCname". Then run WSHShell.Run in a "For Each In"?
Currently, I have a InputBox for "sOldCname" and "sNewCname" but, I don’t want to input for over 800 workstations.
Any help would be appreciated?
Code:
Dim sNewCname
Dim sOldCname
Dim dUserName
Set oFSO = CreateObject("Scripting.FileSystemObject")
set WSHShell = wscript.createObject("wscript.shell")
[COLOR=red]sOldCname = InputBox("Enter computers current name","Windows 2k3 Netdom Rename Script")
sNewCname = InputBox("Enter computers new name","Windows 2k3 Netdom Rename Script")[/color]
dUserName = "username"
Call WSHShell.Run("cmd.exe /K netdom renamecomputer " & sOldCname & " /newname:" & sNewCname & _
" /userd:swab-n\" & dUserName &" /passwordd:* /usero:swab-n\" & dUserName &" /passwordo:* /force /reboot:10")