Page 1 of 1

A CMD lookalike batch file

Posted: 20 Aug 2011 05:06
by BatMaster
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>=--

Re: A CMD lookalike batch file

Posted: 23 Aug 2011 00:59
by phillid
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

Re: A CMD lookalike batch file

Posted: 23 Aug 2011 02:34
by dbenham
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

Re: A CMD lookalike batch file

Posted: 24 Aug 2011 00:42
by phillid
Yeah, yeah. I know. It's good enough to get around the blocking of CMD.exe at my school :D

Re: A CMD lookalike batch file

Posted: 24 Aug 2011 05:45
by dbenham
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: