jb3rry Posted September 11, 2004 Share Posted September 11, 2004 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 Link to comment Share on other sites More sharing options...
a06lp Posted September 12, 2004 Share Posted September 12, 2004 [see post below] Link to comment Share on other sites More sharing options...
a06lp Posted September 12, 2004 Share Posted September 12, 2004 [see post below] Link to comment Share on other sites More sharing options...
Anderz Posted September 12, 2004 Share Posted September 12, 2004 jb3rry: Golden ... works like a charm! It has been added to my image! Link to comment Share on other sites More sharing options...
a06lp Posted September 13, 2004 Share Posted September 13, 2004 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" Link to comment Share on other sites More sharing options...
Anderz Posted September 13, 2004 Share Posted September 13, 2004 See the first post!Use:start /wait "%windir%\system32\wscript.exe %systemdrive%\Install\admin.vbs" Link to comment Share on other sites More sharing options...
a06lp Posted September 13, 2004 Share Posted September 13, 2004 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... Link to comment Share on other sites More sharing options...
jb3rry Posted September 13, 2004 Author Share Posted September 13, 2004 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 Link to comment Share on other sites More sharing options...
a06lp Posted September 13, 2004 Share Posted September 13, 2004 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? 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