在 cmd.exe 中输入 %^ 是 Windows 复活节彩蛋吗?

und*_*ndo 80 windows cmd.exe

当我输入%^cmd 并按下 时Enter,它说:

More?
Run Code Online (Sandbox Code Playgroud)

当我Enter再次按下时,它给出了相同的响应。

这是复活节彩蛋吗?这是什么?

Ste*_*ven 113

不。

微软于 2002 年正式停止在其程序中包含复活节彩蛋,作为其可信计算计划的一部分。http:
//en.wikipedia.org/wiki/Easter_eggs_in_Microsoft_products

微软的 Larry Osterman 在 2005 年 10 月指出,添加一个复活节彩蛋是终止的理由。

如今,向 Microsoft 操作系统添加一个复活节彩蛋是立即终止的理由,因此您极不可能再看到另一个。

http://blogs.msdn.com/b/larryosterman/archive/2005/10/20/483110.aspx

命令提示符正在寻找命令的延续 ( More?),因为它以转义字符 结束^

^ 转义字符可用于使长命令更具可读性,方法是将它们拆分为多行并在行尾转义回车符 + 换行符 (CR/LF)
http://ss64.com/nt/syntax- esc.html

  • 他们摆脱了所有未来的复活节彩蛋以增加可信度?他们认为这如何奏效? (31认同)
  • @Panzercrisis 为什么没有复活节彩蛋?http://blogs.msdn.com/b/larryosterman/archive/2005/10/21/483608.aspx (29认同)
  • 为什么会提示更多?第二次如果你没有对第一次做出任何回应? (12认同)
  • @AlecTeal 是的,但要做到这一点,我必须继续在每行末尾放置 `^`。如果我在第一个 `More?` 提示符下输入一些东西(没有 `^`),它会立即执行,但如果我只是输入,它会再次提示 `More?`。编辑:我已经用 echo 进行了一些进一步的测试,结果表明在“更多?”提示下输入一个空行会在命令行中放置一个文字 CR/LF。不知道为什么我昨天没有遇到那个。 (2认同)
  • 其可信计算计划阻止了无证行为,但他们从未阻止过*有记录的*复活节彩蛋;) (2认同)

tri*_*ger 51

CMD 是基于行的。它一次只读取和执行一行。当您输入并且您还没有完成一行时,它会提示More?.

你的具体事情是没有行结束,所以它在等着看%标志后面会发生什么。

使用括号更容易查看

尝试 dir

然后

(dir
echo %time%
(type c:\windows\win.ini
)
)
Run Code Online (Sandbox Code Playgroud)

只有当该行完成(匹配括号)时才会读取和执行。

这是标点符号列表。

&    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


.
--
Run Code Online (Sandbox Code Playgroud)

  • @toddkaufmann“括号”也可以指(和)。这是该词在美国以外的常见用法,例如,请参见 https://www.englishclub.com/writing/punctuation-round-brackets.htm。 (8认同)
  • 我自己写的。参考资料包括 MSDos 6.22 帮助文件、Windows Vista 命令帮助(即`dir /?`)和 Windows 软件开发工具包。 (6认同)
  • 你在哪里找到这个标点符号列表? (4认同)

und*_*ndo 7

真的很简单,从所有其他答案和评论(以及我自己的一些输入)中,这是我收集到的:

  • 微软不包括复活节彩蛋,这不是一个。
  • 即使打字也只会^给出相同的响应。
  • ^ 用于完成不完整的命令:[感谢@n00b]

    C:\windows\system32>net ^
    More? user
    
    User accounts for \\INFINITEPC
    
    -------------------------------------------------------------------------------
    Administrator            Guest                    Rahul
    The command completed successfully.
    
    Run Code Online (Sandbox Code Playgroud)

  • 所以基本上如果你输入ip^并按回车然后输入config然后 cmd 将它注册为ipconfig.
  • ^用于使长命令更具可读性。[感谢@Steven]
  • 我以为这是一个复活节彩蛋,因为我没想到 cmd 会用人类语言做出回应