Batch file 处理批处理文件可能需要一些帮助(;

Batch file 处理批处理文件可能需要一些帮助(;,batch-file,tree,directory,Batch File,Tree,Directory,我为技术支持诈骗诱饵制作了一个简单的批处理脚本,但我也希望它在诈骗者运行dir/s或tree/s时运行它。我该怎么做?基于此,在键入tree或dir命令之前,此批处理文件将像普通命令提示符一样运行 脚本: @echo off call :Variables :CMD ::::::::::::::::::::::::::::::::::::::::: :: CMD++ - http://mirum.weebly.com/cmd :: ::::::::::::::::::::::::::::::::

我为技术支持诈骗诱饵制作了一个简单的批处理脚本,但我也希望它在诈骗者运行dir/s或tree/s时运行它。我该怎么做?

基于此,在键入
tree
dir
命令之前,此
批处理文件将像普通命令提示符一样运行

脚本:

@echo off
call :Variables
:CMD
:::::::::::::::::::::::::::::::::::::::::
:: CMD++ - http://mirum.weebly.com/cmd ::
:::::::::::::::::::::::::::::::::::::::::
:NormalMode
    color 07
    title C:\WINDOWS\system32\cmd.exe
    echo Microsoft Windows [Version 10.0.14986]
    echo (c) 2016 Microsoft Corporation. All rights reserved.
    goto :cmdCommand
:cmdCommand
    echo.
:cmdCommand2
    set "cmdCommand="
    %echo% C:\Users\%username%&set /p "cmdCommand=>"
    if not defined CmdCommand (goto :CmdCommand2)
    set "CMDCmd=%cmdCommand:"=%"
    call :commands
goto :cmdCommand
:commands
    if /i "%CMDCmd:~0,3%"=="dir" goto :execute
    if /i "%CMDCmd:~0,4%"=="tree" goto :execute
    %cmdCommand%
    goto :cmdCommand
:Variables
    set "cmd++=goto cmdCommand"
    set "echo=<nul set /p ="
goto :EOF

:execute
    echo They entered 'dir' or 'tree'
    pause
goto :EOF
@echo关闭
调用:变量
:CMD
:::::::::::::::::::::::::::::::::::::::::
::CMD++-http://mirum.weebly.com/cmd ::
:::::::::::::::::::::::::::::::::::::::::
:正常模式
颜色07
标题C:\WINDOWS\system32\cmd.exe
echo Microsoft Windows[版本10.0.14986]
echo(c)2016微软公司。保留所有权利。
转到:cmdCommand
:cmdCommand
回声。
:cmdCommand2
设置“cmdCommand=”
%回显%C:\Users\%username%&set/p“cmdCommand=>”
如果未定义CmdCommand(转到:CmdCommand2)
设置“CMDCmd=%cmdCommand:=%”
调用:命令
转到:cmdCommand
:命令
如果/i“%CMDCmd:~0,3%”==“dir”转到:执行
如果/i“%CMDCmd:~0,4%”==“tree”转到:执行
%cmdCommand%
转到:cmdCommand
:变量
设置“cmd++=goto cmdCommand”

set“echo=你希望如何区分骗子和非骗子?我使用adfly翻版找到了一个假的弹出窗口,不知道你想完成什么。你需要更好地描述你的任务,并提供你已经在使用的代码。否则这个问题将被解决。内置命令无法被覆盖(AFAIK),相反,您需要让他们使用一个假控制台,您可以从
CMD++
-@SamDenty创建它-您不需要覆盖命令,只需监视
dir
tree
的命令历史记录。尽管如此,仍然无法成批执行。