cmd.exe に %^ と入力するのは Windows のイースターエッグですか?

cmd.exe に %^ と入力するのは Windows のイースターエッグですか?

%^cmd と入力して を押すとEnter、次のように表示されました:

More?

もう一度押すとEnter、同じ応答がありました。

これはイースターエッグですか?これは何ですか?

答え1

CMD は行ベースです。一度に 1 行だけを読み取って実行します。入力中に行が終了していない場合は、 というプロンプトが表示されますMore?

具体的なことは、行末がないので、記号の後に何が来るかを待つということです%

括弧を使うと見やすくなります

試すdir

それから

(dir
echo %time%
(type c:\windows\win.ini
)
)

行が完全 (括弧が一致) な場合にのみ、行が読み取られて実行されます。

句読点のリストは次のとおりです。

&    separates commands on a line.

&&    executes this command only if previous command's errorlevel is 0.

||    (not used above) executes this command only if previous command's errorlevel is NOT 0

>    output to a file

>>    append output to a file

<    input from a file

|    output of one command into the input of another command

^    escapes any of the above, including itself, if needed to be passed to a program

"    parameters with spaces must be enclosed in quotes

+ used with copy to concatenate files. E.G. copy file1+file2 newfile

, used with copy to indicate missing parameters. This updates the files modified date. E.G. copy /b file1,,

%variablename% a inbuilt or user set environmental variable

!variablename! a user set environmental variable expanded at execution time, turned with SelLocal EnableDelayedExpansion command

%<number> (%1) the nth command line parameter passed to a batch file. %0 is the batch file's name.

%* (%*) the entire command line.

%<a letter> or %%<a letter> (%A or %%A) the variable in a for loop. Single % sign at command prompt and double % sign in a batch file.

\\ (\\servername\sharename\folder\file.ext) access files and folders via UNC naming.

: (win.ini:streamname) accesses an alternative steam. Also separates drive from rest of path.

. (win.ini) the LAST dot in a file path separates the name from extension

. (dir .\*.txt) the current directory

.. (cd ..) the parent directory


\\?\ (\\?\c:\windows\win.ini) When a file path is prefixed with \\?\ filename checks are turned off. 

< > : " / \ | Reserved characters. May not be used in filenames.



Reserved names. These refer to devices eg, 

copy con <filename> 

which copies a file to the console window.

CON, PRN, AUX, NUL, COM1, COM2, COM3, COM4, 

COM5, COM6, COM7, COM8, COM9, LPT1, LPT2, 

LPT3, LPT4, LPT5, LPT6, LPT7, LPT8, and LPT9



Maximum path length              260 characters
Maximum path length (\\?\)      32,767 characters (approx - some rare characters use 2 characters of storage)
Maximum filename length        255 characters


.
--

答え2

いいえ。

マイクロソフトは、2002 年に Trustworthy Computing Initiative の一環として、プログラムにイースター エッグを含めることを正式に停止しました。
https://en.wikipedia.org/wiki/Microsoft 製品のイースターエッグ

マイクロソフトの Larry Osterman 氏は 2005 年 10 月に、イースター エッグを追加することは契約解除の理由になると述べました。

最近では、Microsoft OS にイースター エッグを追加すると、すぐに解雇の理由になるため、同様のイースター エッグが追加される場合はまずありません。
https://blogs.msdn.com/b/larryosterman/archive/2005/10/20/483110.aspx
または:MSDN ブログ アーカイブ

More?コマンドプロンプトは、エスケープ文字で終了しているため、コマンドの継続 ( ) を探しています^

^エスケープ文字は、長いコマンドを複数の行に分割し、キャリッジリターンをエスケープすることで、読みやすくするために使用できます。

  • 行末の改行 (CR/LF)
    構文

答え3

実に簡単です。他のすべての回答とコメント(および私自身の入力)から、次のことを収集しました。

  • Microsoft はイースター エッグを組み込んでいませんが、これはイースター エッグではありません。
  • 入力しても^同じ応答が返されます。
  • ^不完全なコマンドを完了するために使用されます: [thanks @n00b]

    C:\windows\system32>net ^
    More? user
    
    User accounts for \\INFINITEPC
    
    -------------------------------------------------------------------------------
    Administrator            Guest                    Rahul
    The command completed successfully.
    

  • つまり、基本的に と入力しip^て Enter キーを押し、次に と入力するconfigと、cmd はそれを として登録しますipconfig
  • ^長いコマンドを読みやすくするために使用されます。[@Steven に感謝]
  • 私は、cmdが人間の言語で応答するとは思っていなかったので、これはイースターエッグだと思いました。

  • 関連情報