Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to run the following in a batch file and prompt the user to enter "NewUserID", then insert it as a variable. Can this be done with WMI?

wmic useraccount where name='user'call rename name='NewUserID'
share|improve this question

why not prompt the user with set /p I did this with some HP machines to read the AssetTag field fom the BIOS.

You should be able to replace newuserid with your variable.


Start a bat or cmd file.

@echo off

I found a reference to wmic and they discuss variables with this command. Link

share|improve this answer
I tried it and got the following error msg: Code:=0x80041017 Description=Invalide query, Facility=WMI – Dianda Nov 15 '12 at 20:33

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.