在 cmd.exe 輸入 %^ 是 Windows 復活節彩蛋嗎?

在 cmd.exe 輸入 %^ 是 Windows 復活節彩蛋嗎?

當我輸入%^cmd 並按下時Enter,它說:

More?

當我Enter再次按下時,它給出了相同的回應。

這是復活節彩蛋嗎?這是什麼?

答案1

CMD 是基於行的。它一次只讀取並執行一行。當您正在打字並且尚未完成一行時,它會提示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 年,作為可信賴運算計畫的一部分,微軟正式停止將復活節彩蛋納入其計畫中。
https://en.wikipedia.org/wiki/Easter_eggs_in_Microsoft_products

微軟的 Larry Osterman 在 2005 年 10 月指出,添加復活節彩蛋是終止合約的理由。

如今,向 Microsoft 作業系統添加復活節彩蛋會立即導致終止,因此您不太可能會看到另一個。
https://blogs.msdn.com/b/larryosterman/archive/2005/10/20/483110.aspx
或者:MSDN 部落格存檔

命令提示字元正在尋找More?命令的延續 (),因為它以轉義字元 結尾^

^ 轉義字元可用於將長命令分成多行並轉義回車符,從而使長命令更具可讀性

答案3

真的很簡單,從所有其他答案和評論(以及我自己的一些意見)中,這就是我收集到的:

  • 微軟不包含復活節彩蛋,這也不是。
  • 即使打字也只會^給出相同的回應。
  • ^用於完成不完整的命令:[感謝@n00b]

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

  • 所以基本上,如果您鍵入ip^並按 Enter 鍵,然後鍵入config,那麼 cmd 會將其註冊為ipconfig.
  • ^用於使長命令更具可讀性。 [感謝@史蒂文]
  • 我以為這是一個復活節彩蛋,因為我沒想到 cmd 會用人類語言回應

  • 相關內容