September 11, 200421 yr This has come up in numerous post....Below is the code I Call from RunOnceEx....Afterwards you do need to reboot or else the administrator group will still show "Administrator" After reboot the administrator group will show the new name for administrator.RunOnceExREG ADD %KEY%\215 /VE /D "Renaming Local Admin" /fREG ADD %KEY%\220 /V 1 /D Wscript.exe "%CDROM%\Software\vbs\admin.vbs" /f------------------------------------------------------------------------'vbscriptOn Error Resume NextstrComputer = "."strCompPass = "Password12"strRemoveHA = "HelpAssistant"strRemoveSup = "SUPPORT_388945a0"strRemoveAdmin = "Administrator"Set WshShell = WScript.CreateObject("WScript.Shell")Set WshNetwork = WScript.CreateObject("WScript.Network")Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & "." & "\root\default:StdRegProv")strComputer = WshNetwork.ComputerName'Renaming AdminSet oMachine = GetObject("WinNT://" & strComputer)Set oInfoUser = GetObject("WinNT://" & strComputer & "/Administrator,user")set oUser = oMachine.MoveHere(oInfoUser.ADsPath,"NEWNAME")'Reseting Admin PasswordSet objUser = GetObject("WinNT://" & strComputer & "/NEWNAME, user")objUser.SetPassword "Password12"objUser.SetInfo'Renaming GuestSet oMachine = GetObject("WinNT://" & strComputer)Set oInfoUser = GetObject("WinNT://" & strComputer & "/Guest,user")set oUser = oMachine.MoveHere(oInfoUser.ADsPath, "NoGuest")'Reseting Guest PasswordSet objUser = GetObject("WinNT://" & strComputer & "/NoAccess, user")objUser.SetPassword "&*UIer78aB#4"objUser.SetInfo'Disabling Guest AccountSet objUser = GetObject("WinNT://" & strComputer & "/NoAccess")objUser.AccountDisabled = TrueobjUser.SetInfo'Deleting Help Assistant Account, Support AccountSet objComputer = GetObject("WinNT://" & strComputer & "")objComputer.Delete "user", strRemoveHAobjComputer.Delete "user", strRemoveSup
September 13, 200421 yr can someone explain how to use this without using RunOnceEx.cmd?i tried pasting the code below into a .cmd file, but it wont work. what am i doing wrong?start /wait "%systemdrive%\Install\admin.vbs"
September 13, 200421 yr See the first post!Use:start /wait "%windir%\system32\wscript.exe %systemdrive%\Install\admin.vbs"
September 13, 200421 yr See the first post!Use:start /wait "%windir%\system32\wscript.exe %systemdrive%\Install\admin.vbs"i saw the post, i just wasnt sure how to chnage the coding correctly. thanks!anyway, its not working correctly...the .cmd window comtaining that code opens, and then another cmd window pops up, and just stays like that...
September 13, 200421 yr Author Here is the original code that was in my start.cmd. I then later moved to RunnceEX.ECHO Adjusting ProfilesECHO Please wait...start /wait %systemdrive%\install\Admin.vbsIn the RunOnceEx I was have problems every now and then where the VBS script was not being associated with Wscript and would not run.Someone on this board recommeded using Trying the code below and it has worked every since. This way there is not an association problem.REG ADD %KEY%\215 /VE /D "Massaging Local Admin" /fREG ADD %KEY%\220 /V 1 /D "WScript.exe %CDROM%\Software\vbs\admin.vbs" /fHope this helps
September 13, 200421 yr Here is the original code that was in my start.cmd. I then later moved to RunnceEX.ECHO Adjusting ProfilesECHO Please wait...start /wait %systemdrive%\install\Admin.vbsIn the RunOnceEx I was have problems every now and then where the VBS script was not being associated with Wscript and would not run.Someone on this board recommeded using Trying the code below and it has worked every since. This way there is not an association problem.REG ADD %KEY%\215 /VE /D "Massaging Local Admin" /fREG ADD %KEY%\220 /V 1 /D "WScript.exe %CDROM%\Software\vbs\admin.vbs" /fHope this helpsI don't get it.I copied and pasted your exact code, and when I run the .cmd, it displays the first two lines, but just pauses on the "start /wait %systemdrive%\install\Admin.vbs" line...[edit] it stays there, on that line, for about 2-3 minutes, then completes (i think)...1) Why does it take so long?2) After it finishes, I go into a cmd and type "net user" to see what comes up. There is no account named "NEWNAME" (i wanted to see if it worked).However, I didn't have an account named "Administrator" either, my admin was named something else. Would this effect the code?3) Also, I notice now that I have a "NoGuest" account?? What's that about?
Create an account or sign in to comment