Qiita Teams that are logged in
You are not logged in to any team

Log in to Qiita Team
Community
OrganizationEventAdvent CalendarQiitadon (β)
Service
Qiita JobsQiita ZineQiita Blog
0
Help us understand the problem. What are the problem?

More than 1 year has passed since last update.

Organization

32桁の乱数を作成したい時

APIKEYを作成したい時など、乱数が欲しいときなど
バッチで手軽に使用できるコマンドです。


32桁の英数字+記号の乱数を作成します。
以下のファイルを作成してください。

ransu.bat
@echo off
powershell -NoProfile -ExecutionPolicy Unrestricted -Command "& { $char='abcdefghkmnprstuvwxyzABCDEFGHKLMNPRSTUVWXYZ123456789!$^&/()=?*+#_'; -join ${char}[(1..32 | ForEach-Object { Get-Random -Maximum ${char}.length })] }"
pause

あとは作られたransu.batをダブルクリックしてください。
以下のように出ればOK
image.png

英数字のみの場合

ransu_eisu.bat
@echo off
powershell -NoProfile -ExecutionPolicy Unrestricted -Command "& { $char='abcdefghkmnprstuvwxyzABCDEFGHKLMNPRSTUVWXYZ123456789'; -join ${char}[(1..32 | ForEach-Object { Get-Random -Maximum ${char}.length })] }"
pause
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
0
Help us understand the problem. What are the problem?