1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

Windowsのコマンドプロンプト(bat)でローカルユーザー削除

Last updated at Posted at 2023-07-25

概要

Administrator権限を持ってしまっている初期アカウントを消したい時など。

やり方

管理者権限が必要。

rem 『unko』という名前のユーザーを削除
net user unko /delete

やり方(削除と同時に結果の確認)

rem 『unko』という名前のユーザーを削除
net user unko /delete

rem ユーザーアカウントの画面開く(削除できているかの確認用)
control userpasswords

control userpasswords で下記画面が開く。
image.png

そして、『ユーザーアカウントの管理』をクリックで下記画面を開ける。
image.png

蛇足

ドメイン参加後ならActiveDirectoryで何とかしたい!
バッチとかコマンド発行するのも面倒くさい!
グループポリシーとかで何とかしたい!
けど、やり方まだ調べ切れてない…。

あと、『ユーザーアカウントの管理』をクリックした先をコマンドで開きたかったけど、やり方見つからなかった。

参考サイトさん

バージョン

Windows 10 Pro 22H2 19045.3208

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?