Jump to content

Renaming Administrator\Guest etc


jb3rry

Recommended Posts

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.

RunOnceEx

REG ADD %KEY%\215 /VE /D "Renaming Local Admin" /f

REG ADD %KEY%\220 /V 1 /D Wscript.exe "%CDROM%\Software\vbs\admin.vbs" /f

------------------------------------------------------------------------

'vbscript

On Error Resume Next

strComputer = "."

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 Admin

Set oMachine = GetObject("WinNT://" & strComputer)

Set oInfoUser = GetObject("WinNT://" & strComputer & "/Administrator,user")

set oUser = oMachine.MoveHere(oInfoUser.ADsPath,"NEWNAME")

'Reseting Admin Password

Set objUser = GetObject("WinNT://" & strComputer & "/NEWNAME, user")

objUser.SetPassword "Password12"

objUser.SetInfo

'Renaming Guest

Set oMachine = GetObject("WinNT://" & strComputer)

Set oInfoUser = GetObject("WinNT://" & strComputer & "/Guest,user")

set oUser = oMachine.MoveHere(oInfoUser.ADsPath, "NoGuest")

'Reseting Guest Password

Set objUser = GetObject("WinNT://" & strComputer & "/NoAccess, user")

objUser.SetPassword "&*UIer78aB#4"

objUser.SetInfo

'Disabling Guest Account

Set objUser = GetObject("WinNT://" & strComputer & "/NoAccess")

objUser.AccountDisabled = True

objUser.SetInfo

'Deleting Help Assistant Account, Support Account

Set objComputer = GetObject("WinNT://" & strComputer & "")

objComputer.Delete "user", strRemoveHA

objComputer.Delete "user", strRemoveSup

Link to comment
Share on other sites


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

Here is the original code that was in my start.cmd. I then later moved to RunnceEX.

ECHO Adjusting Profiles

ECHO Please wait...

start /wait %systemdrive%\install\Admin.vbs

In 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" /f

REG ADD %KEY%\220 /V 1 /D "WScript.exe %CDROM%\Software\vbs\admin.vbs" /f

Hope this helps

Link to comment
Share on other sites

Here is the original code that was in my start.cmd.  I then later moved to RunnceEX.

ECHO Adjusting Profiles

ECHO Please wait...

start /wait %systemdrive%\install\Admin.vbs

In 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" /f

REG ADD %KEY%\220 /V 1 /D "WScript.exe %CDROM%\Software\vbs\admin.vbs" /f

Hope this helps

I 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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...