how to solve this problem to change username

May 1, 2013 at 02:02:06
Specs: Windows 7
wmic batch file
@echo off
set /p user=currentusername:
set /p newusername=new username:
wmic useraccount where name='%user%'call rename name='%newusername%'

See More: how to solve this problem to change username

Report •


#1
May 1, 2013 at 07:40:58
What are you trying to do? A little more direction or information would really help me help you!

Law if Logical Argument: Anything is possible if you don't know what you're talking about.


Report •

#2
May 1, 2013 at 08:34:37
It seems like its the right format, the only thing I wonder is is there supposed to be a space before the call statement? I am wondering if its a transcription error, or if it is in the original statement.

If the space is there, what is the error you are getting with the statement? have you tried turning echo off for that line?

Does the original username that is user entered by the user exist, and does the computer you are using have privileges.

:: mike


Report •

#3
May 1, 2013 at 09:43:51
I apologize for not catching what you were trying to do right off the bat. Try this and let me know how it works.

@echo off 
set /p user=currentusername:
set /p newusername=new username:
echo.
echo %user% will be changed to %newusername%
echo.
echo Press any Key to change Username
pause >nul
wmic useraccount where name='%user%' rename '%newusername%'

Law if Logical Argument: Anything is possible if you don't know what you're talking about.


Report •

Related Solutions

#4
May 1, 2013 at 10:37:57
I was under the impression that the syntax was call rename, however I don't do much with wmic, and i'm working with xp.

:: mike


Report •


Ask Question