A CMD lookalike batch file

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
BatMaster
Posts: 28
Joined: 22 Dec 2010 12:53

A CMD lookalike batch file

#1 Post by BatMaster » 20 Aug 2011 05:06

The batch file was inspired by a story my dad told me about a freind of his,
my dads freind made a program that look exactly like command prompt,
but completly ignored the users input!
mine only uses cls
^*EDIT*^ Fixed the code it was because of a missing registryor something like that
anyway here is the code

Code: Select all

@echo off &setlocal enabledelayedexpansion
setlocal enabledelayedexpansion
:start
echo(
set /p input=C:\Users\Admin\Desktop^>
if /i "%input%"=="%input%" goto start

--=<BatMaster>=--

phillid
Posts: 109
Joined: 03 Apr 2010 20:27
Location: Wellington, New Zealand
Contact:

Re: A CMD lookalike batch file

#2 Post by phillid » 23 Aug 2011 00:59

I made a full CMD batch file a while ago because I couldn't use CMD.exe:

Code: Select all

@echo off
:cmdloop
set /p cmd=%cd%^>
%cmd%
goto cmdloop


The only thing it can't do is 'echo off', although that would have a simple fix

Just thougth I'd share this one :D

phillid

dbenham
Expert
Posts: 2461
Joined: 12 Feb 2011 21:02
Location: United States (east coast)

Re: A CMD lookalike batch file

#3 Post by dbenham » 23 Aug 2011 02:34

phillid wrote:I made a full CMD batch file a while ago because I couldn't use CMD.exe:
The only thing it can't do is 'echo off', although that would have a simple fix
Off the top of my head I can think of a few other things it can't do :wink:

- Line continuation

- Multi-line code blocks enclosed by parentheses

- Can't change the PROMPT

- Normal variable expansion fails unless command prefixed with CALL (which fails for FOR or IF commands)

Then there are things it can do that CMD.EXE can't

- SETLOCAL / ENDLOCAL

- ECHO ON will of course expose BAT file

- exit with GOTO :EOF

I'm sure there are other differences.

Dave Benham

phillid
Posts: 109
Joined: 03 Apr 2010 20:27
Location: Wellington, New Zealand
Contact:

Re: A CMD lookalike batch file

#4 Post by phillid » 24 Aug 2011 00:42

Yeah, yeah. I know. It's good enough to get around the blocking of CMD.exe at my school :D

dbenham
Expert
Posts: 2461
Joined: 12 Feb 2011 21:02
Location: United States (east coast)

Re: A CMD lookalike batch file

#5 Post by dbenham » 24 Aug 2011 05:45

phillid wrote:Yeah, yeah. I know. It's good enough to get around the blocking of CMD.exe at my school :D
Most definitely :D
A place where you can't access CMD.EXE :!: :?: :cry: What an AWWWFUL thought :lol:

Post Reply