Go Back   Forums > Community Chatterbox > Tech Corner
Memberlist Forum Rules Today's Posts
Search Forums:
Click here to use Advanced Search

Reply
 
Thread Tools Display Modes
Old 01-11-2006, 11:56 AM   #1
Morrin
Underground
 
Morrin's Avatar

 
Join Date: Oct 2004
Location: Iisalmi, Finland
Posts: 416
Default

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!
Morrin is offline                         Send a private message to Morrin
Reply With Quote
Old 01-11-2006, 11:59 AM   #2
JJXB
Pi-voh
 
JJXB's Avatar

 
Join Date: Oct 2004
Location: Godmanchester, England
Posts: 850
Default

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******** -
-**********************************-
------------------------------------
__________________
~Ceramic White PSP Status~
FW: 5.00 M33-6
Memory Stick: 8gb
JJXB is offline                         Send a private message to JJXB
Reply With Quote
Old 01-11-2006, 12:23 PM   #3
Morrin
Underground
 
Morrin's Avatar

 
Join Date: Oct 2004
Location: Iisalmi, Finland
Posts: 416
Default

I still cannot make the screen completely blank, except for the text that I wan't to appear
Morrin is offline                         Send a private message to Morrin
Reply With Quote
Old 01-11-2006, 02:14 PM   #4
JJXB
Pi-voh
 
JJXB's Avatar

 
Join Date: Oct 2004
Location: Godmanchester, England
Posts: 850
Default

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
__________________
~Ceramic White PSP Status~
FW: 5.00 M33-6
Memory Stick: 8gb
JJXB is offline                         Send a private message to JJXB
Reply With Quote
Old 01-11-2006, 04:39 PM   #5
Japo
Autonomous human
 
Japo's Avatar


 
Join Date: Mar 2006
Location: ,
Posts: 4,613
Default

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.
__________________
Life starts every day anew. Prospects not so good...
Japo is offline                         Send a private message to Japo
Reply With Quote
Old 01-11-2006, 06:33 PM   #6
Morrin
Underground
 
Morrin's Avatar

 
Join Date: Oct 2004
Location: Iisalmi, Finland
Posts: 416
Default

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.
Morrin is offline                         Send a private message to Morrin
Reply With Quote
Old 01-11-2006, 07:11 PM   #7
Japo
Autonomous human
 
Japo's Avatar


 
Join Date: Mar 2006
Location: ,
Posts: 4,613
Default

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]
__________________
Life starts every day anew. Prospects not so good...
Japo is offline                         Send a private message to Japo
Reply With Quote
Old 02-11-2006, 05:14 AM   #8
Morrin
Underground
 
Morrin's Avatar

 
Join Date: Oct 2004
Location: Iisalmi, Finland
Posts: 416
Default

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.
Morrin is offline                         Send a private message to Morrin
Reply With Quote
Old 02-11-2006, 10:23 AM   #9
Shrek
Abandonia Ogre


 
Join Date: Nov 2004
Location: Lisboa, Portugal
Posts: 506
Default

<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"
Shrek is offline                         Send a private message to Shrek
Reply With Quote
Old 02-11-2006, 11:36 AM   #10
Morrin
Underground
 
Morrin's Avatar

 
Join Date: Oct 2004
Location: Iisalmi, Finland
Posts: 416
Default

Prompt command looks like a good compromise to this. Thanks a lot Shrek!
Morrin is offline                         Send a private message to Morrin
Reply With Quote
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump
 


The current time is 09:29 AM (GMT)

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