spidercop Posted July 27, 2005 Share Posted July 27, 2005 (edited) i cant script but can somoene help me im dutch so disregard errors i want e script that asks tho change the administrator pasword en name en i have e extra account i want it tho ask tho change the name of account en change the pasword of it also i have e script that asks tho change the Registered Owner/Organization name ok i found al the things i need here they are change owner pc name from this forum'ChgOwnOrg.vbs - Change Win9x Registered Owner/Organization.'Modified for Windows XPOption ExplicitSet ws = WScript.CreateObject("WScript.Shell")Dim ws, t, p1, p2, p3, p4, p5, n, g, j, h, f, k, cn, cg, cjDim itemtypep1 = "HKLM\Software\Microsoft\Windows NT\CurrentVersion\"p2 = "HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\ComputerName\ComputerName\"p3 = "HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\Tcpip\Parameters\"p4 = "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\ComputerName\ComputerName\"p5 = "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\"n = ws.RegRead(p1 & "RegisteredOwner")g = ws.RegRead(p1 & "RegisteredOrganization")j = ws.RegRead(p2 & "ComputerName")h = ws.RegRead(p3 & "NV Hostname")f = ws.RegRead(p4 & "ComputerName")k = ws.RegRead(p5 & "NV Hostname")t = "Change Utility"cn = InputBox("Type new Owner and click OK", t, n)If cn <> "" Thenws.RegWrite p1 & "RegisteredOwner", cnEnd Ifcg = InputBox("Type new Organization and click OK.", t, g)If cg <> "" Thenws.RegWrite p1 & "RegisteredOrganization", cgEnd Ifcj = InputBox("Type new Computer name and click OK", t, j)If cj <> "" Thenws.RegWrite p2 & "ComputerName", cjws.RegWrite p3 & "NV Hostname", cjws.RegWrite p4 & "ComputerName", cjws.RegWrite p5 & "NV Hostname", cjEnd If change admin pasword from visualbasicscripthingDim strComputer strComputer = "." Set objUser = GetObject("WinNT://" & strComputer & "/Administrator, user") If Err.Number <> 0 Then MsgBox Now & vbTab & "Error connecting to " & strComputer & " --- " & Err.Description Err.Clear ErrorOccurred = True Else ' Set the password for the account newPassword = inputbox ("Give new password",,"Create P-word") objUser.SetPassword newPassword objUser.SetInfo If Err.Number <> 0 Then outFile.writeline Now & vbTab & "Error setting password for " & strComputer & _ "\Administrator" & " --- " & Err.Description Err.Clear ErrorOccurred = True Else Msgbox Now & vbTab & "Password set for " & strComputer & "\Administrator" End If End If create new user from visualbasicscripthingusername=inputbox("Iuput user name:") password=inputbox("Password:") set a=createobject("wscript.shell") a.run("%systemroot%\system32\cmd /k net user /add "&username&" "&chr(34)&password&chr(34)&" "&"&exit") a.run("%systemroot%\system32\cmd /k net localgroup administrators /add "&username&" "&"&exit") these files are called soon as installation finisch en then asks al the info for new account new pasword for admin new computer name like all the things u stil need tho change on new pc exept drivers then if i forgot somthing plz say so Edited July 27, 2005 by spidercop Link to comment Share on other sites More sharing options...
spidercop Posted July 27, 2005 Author Share Posted July 27, 2005 (edited) every thing works exept for the user maker it dont ad the account tho administrator i got error on this in second batch file that created that user dont existusername=inputbox("Iuput user name:") password=inputbox("Password:") set a=createobject("wscript.shell") a.run("%systemroot%\system32\cmd /k net user /add "&username&" "&chr(34)&password&chr(34)&" "&"&exit") a.run("%systemroot%\system32\cmd /k net localgroup administrators /add "&username&" "&"&exit") this is the vbs script i get the erro with i get error wen it ads the user the local administrators i changed the exit tho pause tho waths the error my ansers tho the questions are username spiderman en pasword evelkenievel so then go en i get this one cmd wiindow say opdracht voltooid other say Deze groep of gebruiker bestaat niet: spiderman. Typ NET HELPMSG 3783 voor meer hulp. Druk op een toets om door te gaan. . . it says it in dutch in engels it like this this groep or user dont exist username=inputbox("Iuput user name:") password=inputbox("Password:") set a=createobject("wscript.shell") a.run("%systemroot%\system32\cmd /k net user /add "&username&" "&chr(34)&password&chr(34)&" "&"&exit") a.run("%systemroot%\system32\cmd /k net localgroup administrators /add "&username&" "&"&exit") Edited July 30, 2005 by spidercop Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now