Forums

Forums (http://www.abandonia.com/vbullet/index.php)
-   Tech Corner (http://www.abandonia.com/vbullet/forumdisplay.php?f=23)
-   -   Dos (http://www.abandonia.com/vbullet/showthread.php?t=12530)

Morrin 01-11-2006 11:56 AM

Hi!

I was nostalgizing with DOS once again, but it seems that I have forgotten more than I believed. So, I create a file called itworks.bat [edit itworks.bat]

Now, what I would like to do is to create a list of text that appears and removes the "c:\>" indicator. The text I wrote in itworks.bat is like this:

echo off
cls
IT WORKS!

The good think is that the "IT WORKS!" text is printed at the screen, but the "c:\>" Still appears in the screen. I remember doing something with @ mark in old days but I cannot recall anymore.

So help this old man! :)

JJXB 01-11-2006 11:59 AM

example of what i did once:
Code:

@echo ------------------------------------
@echo -**********************************-
@echo - Worms: United And Reinforcements -
@echo -******** Multiplayer Menu******** -
@echo -**********************************-
@echo ------------------------------------

which displays:
Code:

------------------------------------
-**********************************-
- Worms: United And Reinforcements -
-******** Multiplayer Menu******** -
-**********************************-
------------------------------------


Morrin 01-11-2006 12:23 PM

I still cannot make the screen completely blank, except for the text that I wan't to appear

JJXB 01-11-2006 02:14 PM

isn't the command cls for clearing the screen?
try putting that before
i.e.
@cls (so it doesn't show execution of the command)
@echo -----------------
@echo - example -
@echo -----------------

edit- just tried it and it doesn't do that :( i can't think of any solution at the mo but i hope i helped

Japo 01-11-2006 04:39 PM

You don't need to add a "@" at the beginning of each line, just start the file with "@echo off" and the subsequent commands will be muted --until you should add a "echo on" line, don't ask me why you'd want to. I'm not completely sure of what you want, is it just to display "IT WORKS!" and then get back to the DOS prompt? If so try this:

Code:

@echo off
cls
echo IT WORKS!
echo.

The "echo." is a blank line, otherwise the prompt would appear ugly just below "IT WORKS!" without separation, you can insert as many as you like.

You can find extensive help about DOS batch files, basic stuff like that and advanced features like variables, parameters, "if" sentences, "for" loops, etc. in HELP.COM + HELP.HLP.

Morrin 01-11-2006 06:33 PM

I tried it like that and it works, but it still gives the c:\> line. Im starting to doubt that this is impossible. I just have memory that it worked back days.

Japo 01-11-2006 07:11 PM

So you want the prompt to disappear? Why on Earth? Okay that's changed with the "prompt" command, surprisingly enough. Only that it's designed to customize the prompt, but you'll have to figure for yourself if it can make it disappear, here you have the syntax:

http://www.computerhope.com/prompthl.htm

Then instead you could make the batch file to show what you appear to want, withouth the prompt, and then get back to it when you press any key. I think this might work:

Quote:

@echo off
cls
echo IT WORKS!
echo.
pause > nul[/b]

Morrin 02-11-2006 05:14 AM

Just cosmetic option. It would look cool, if the program would give these options and the prompt would not be there. Then there would be command, like "quit" (separate .bat file -> command) that would bring the prompt back. I don't get it why echo off doesn't work in bat file, since it works if you write it in dos manually.

Shrek 02-11-2006 10:23 AM

<div class='quotetop'>QUOTE(Morrin @ Nov 2 2006, 06:14 AM) [snapback]264916[/snapback]</div>
Quote:

I don't get it why echo off doesn't work in bat file, since it works if you write it in dos manually.
[/b]
Because the "echo" acts a "remark" or a comment (or whatever) when placed in the *.bat file. You place a line like
Code:

echo IT WORKS!
and it will display the line without the prompt as if it was a comment.
If you wish to remove the prompt after that, you'll have to use the "prompt" command to make something like this:
Code:

@echo off
cls
echo IT WORKS!
echo.
prompt -

This will display a "-" instead of the "c:\" prompt. To recover the "c:\prompt", just type "prompt"

Morrin 02-11-2006 11:36 AM

Prompt command looks like a good compromise to this. Thanks a lot Shrek!


The current time is 06:50 PM (GMT)

Powered by vBulletin® Version 3.7.1
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.