Jump to content

Recommended Posts

Posted

How can I delete the Administrator folder on reboot

I renamed Administrator account but it is using the old folder - I don't like this


Posted

As far as I know, you can only change the name of the Administrator account and its folder through an unattended installation of Windows. You can change the name as many times as you like when in Windows, but the folder will always be named what was defined during installation.

Posted (edited)

Just run the following batch as the administrator, then the administrator's folder is deleted after the next login. But it would be a piitty, if the next user, who logs in, is the administrator. If you want to make sure, that this isn't happening, you could write a little batch, which only deletes the folder, if the logged in user, isn't the administrator.

@echo off
SET KEY=HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceEx
REG ADD %KEY% /V TITLE /D "Installing Applications" /f
REG ADD %KEY%\070 /VE /D "Delete Administrators folder" /f
REG ADD %KEY%\070 /V 1 /D "rmdir /s /Q \"%USERPROFILE%\" " /f

You also could do the job, without having to run the script as the administrator and having the script run before login, but first thing would be a little more complicated ( would have to get the folder's path out of the registry) and the second thing I'M not quite sure, how to do, would be necessary a little reading.

To change the name of administrator's directory, you've got to change the path in

HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList\SID\ProfileImagePath, where for SID you have to enter the administrator's SID.

Hope this helps a little.

Edited by Doc Symbiosis
Posted (edited)
To change the name of administrator's directory, you've got to change the path in

HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList\SID\ProfileImagePath, where for SID you have to enter the administrator's SID.

Well... It works. I'd like to know how to get the SID (domain) through a batch file too. The full string always starts with "S-1-5-21-" and always ends in "-500".

Edited by Tomcat76

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
  • Recently Browsing   0 members

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