MSFN Forum: Blinking text in batch-file - MSFN Forum

Jump to content


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Blinking text in batch-file and howto clear only one ECHO-line Rate Topic: -----

#1 User is offline   HØLLØW 

  • Member
  • PipPip
  • Group: Members
  • Posts: 135
  • Joined: 01-March 07
  • OS:Windows 7 x64
  • Country: Country Flag

  Posted 14 February 2010 - 04:47 PM

Hi guys out there,

can anyone tell me if it's possible to make a text blinking in a batch-file?

I read a few sites about that but I thinks it's very complex to do that?!

Is there a 3rd-party tool to do this? I always usie "EchoX" to make colored text, but it has no functionality to make blinking text :huh:



Is it also possible to clear just one line in a ECHO-command in batch?
With CLS I always clear the whole screen...




Thank you

This post has been edited by HØLLØW: 14 February 2010 - 04:55 PM



#2 User is offline   HØLLØW 

  • Member
  • PipPip
  • Group: Members
  • Posts: 135
  • Joined: 01-March 07
  • OS:Windows 7 x64
  • Country: Country Flag

Posted 18 February 2010 - 12:48 PM

No ideas out there? :huh:

#3 User is offline   Tripredacus 

  • K-Mart-ian Legend
  • Group: Super Moderator
  • Posts: 8,675
  • Joined: 28-April 06
  • OS:Server 2012
  • Country: Country Flag

Posted 18 February 2010 - 03:34 PM

I'm thinking maybe going back to BASIC... If you can get QBASIC from Windows 95 (or 98?) you build scripts to do things like this. I also remember making cmdline/DOS programs like this that was able to run programs, display different info, and make text blink. Unfortunately I lost my old DOS and QBASIC books in a flood I had about a year ago, so only the internet is left. Here is a site that talks about using flashing text in QBASIC:

http://www.qbcafe.ne...g-qbasic-2.html

#4 User is offline   MDGx 

  • 98SE2ME + 98MP10
  • Group: Super Moderator
  • Posts: 2,678
  • Joined: 22-November 04
  • OS:none specified
  • Country: Country Flag

Posted 18 February 2010 - 03:55 PM

Depends what type of OS you're using.

In MS-DOS 6/7/8 [6.22 is last stand-alone DOS based OS from MS; MS-DOS 7.00, 7.10 + 8.00 are part of Windows 95, 98 + ME, respectively] it is possible to have blinking text, using an ANSI device driver [pre-loaded in memory from CONFIG.SYS or AUTOEXEC.BAT], like ANSI.SYS included with all MS-DOS 6/7/8 [Win95/98/ME] releases, or 3rd party ANSI.COM [free].
ANSI allows full spectrum of 16 VGA colors, blinking, layouts, custom prompts, etc... in real/native DOS mode [outside Windows GUI], but a lil more restricted (no blinking) under Win9x GUI DOS box/session/window.

But if you're using any WinNTx based OSes [NT4, 2000, XP, 2003, Vista, 2008 or 7], you're out of luck, because the DOS console is merely a virtual machine, not the "real" DOS mode.
And Microsoft disabled completely [mainly for security + compatibility reasons] the access to real mode hardware resources.
Therefore in NTx OSes there is no text blinking in DOS [DOS is available only as a window/session/box/console = VM (Virtual Machine)], nor keyboard shortcuts for that matter. And the ANSI functions are implicitly disabled [although the obsolete file ansi.sys is still found in %windir%\system32], since there is no "real" DOS mode.

EchoX uses same functions as DOS VM to display colors.

There might be a tiny possibility...
1. find a 3rd party NT-compatible DOS tool/device [?] which allows limited access to hardware resources in DOS VMs [console];
2. try to learn how to tweak MS PowerShell [free add-on in XP/2003/Vista/2008 and native in Win7]:
http://www.mdgx.com/xptoy.htm#PWS
Tweaking PowerShell to display blinking text is probably a long shot, but I have no experience using it.

Good luck.

BTW:
Basic/Qbasic also uses ANSI functions to change colors and blink. Therefore most of those functions will be disabled in NTx OSes.
Although I haven't tried runnig Qbasic programs from DOSBox [free GPL]: ;)
http://www.dosbox.com/

HTH

#5 User is online   jaclaz 

  • The Finder
  • Group: Developers
  • Posts: 11,436
  • Joined: 23-July 04
  • OS:none specified
  • Country: Country Flag

Posted 18 February 2010 - 07:32 PM

The blinking is supported in "pure" DOS and In "full screen" mode only with ANSI, AFAICR:
http://www.robvanderwoude.com/ansi.php

Another possibility may be using a bash cmdline shell for NT, original bash does have blinking text supported. :unsure:

Check this one:
http://www.claus-jue...mls/xewc_e.html
it may have a similar effect to what you are looking for.

jaclaz

#6 User is offline   Tripredacus 

  • K-Mart-ian Legend
  • Group: Super Moderator
  • Posts: 8,675
  • Joined: 28-April 06
  • OS:Server 2012
  • Country: Country Flag

Posted 19 February 2010 - 11:15 AM

View PostMDGx, on 18 February 2010 - 03:55 PM, said:

BTW:
Basic/Qbasic also uses ANSI functions to change colors and blink. Therefore most of those functions will be disabled in NTx OSes.
Although I haven't tried runnig Qbasic programs from DOSBox [free GPL]: ;)
http://www.dosbox.com/

HTH


I still have some old software that was written in Q/BASIC or one of its derivatives. I have found that these old programs only run in Dosbox. For example, one of them I know is written in BASIC (based on the file headers of the EXEs) if ran in XP from double-click or command prompt will spike the CPU to 100% and not open. In DOSbox, it uses maybe 2% of CPU. It may have something to do with your other comments. I need to figure out myself how DOSBox works better, because this specific app I am using (which has blinking text btw) is abandonware and I wanted to update it. Only way I can find is a hex editor, unless you know of any BASIC decompilers. I can provide specific BASIC compiler info if needed.

#7 User is offline   DataCracker7899 

  • Newbie
  • Group: Members
  • Posts: 15
  • Joined: 02-January 13
  • OS:Windows 7 x86
  • Country: Country Flag

Posted 02 January 2013 - 12:06 PM

easy
you can change blue text.

title HAXCOM
:ST4RT
color a
@echo off
title HAXCOM
cls
echo Your Text Here
goto ST4RT

and special animation

title HAXCOM
color a
@echo off
title HAXCOM
cls
ping localhost -n 2 >nul
echo Your Text Here
ping localhost -n 2 >nul
echo second text here
pause

#8 User is online   jaclaz 

  • The Finder
  • Group: Developers
  • Posts: 11,436
  • Joined: 23-July 04
  • OS:none specified
  • Country: Country Flag

Posted 02 January 2013 - 02:27 PM

View PostDataCracker7899, on 02 January 2013 - 12:06 PM, said:

easy
you can change blue text.


Perfect. :thumbup

OP:

View PostHØLLØW, on 14 February 2010 - 04:47 PM, said:

Is it also possible to clear just one line in a ECHO-command in batch?
With CLS I always clear the whole screen...


What you are suggesting is NOT about having blinking text, but rather about cyclically clear and re-display the whole console text area.

jaclaz

#9 User is offline   Ponch 

  • MSFN Master
  • Group: Patrons
  • Posts: 2,959
  • Joined: 23-November 05
  • OS:none specified
  • Country: Country Flag

Posted 15 January 2013 - 03:04 PM

and it's an old thread as well, I know everybody can get caught :rolleyes: but DataCracker is like looking for them. :D

#10 User is offline   Yzöwl 

  • Wise Owl
  • Group: Super Moderator
  • Posts: 4,364
  • Joined: 13-October 04
  • OS:Windows 7 x64

Posted 15 January 2013 - 03:57 PM

Now it's been reborn, I thought the attatchment may be interesting.

Attached File(s)

  • Attached File  Blink.zip (463bytes)
    Number of downloads: 18


#11 User is offline   DataCracker7899 

  • Newbie
  • Group: Members
  • Posts: 15
  • Joined: 02-January 13
  • OS:Windows 7 x86
  • Country: Country Flag

Posted 17 February 2013 - 10:36 AM

That is very easy here is the code

title G7 NanoHax
color a
@echo off
title G7 NanoHax
cls
:123
cls
echo YOUR TEXT HERE
goto 123

then save as NameMe.bat and as 'All Files'

you can download a example i made down there called 'Blinkin' Text.zip' it's in zip cause it didn't allow .bat there is .exe version too. there is no malware virus spyware adware rootkits or anything malicious

Attached File(s)



#12 User is offline   DataCracker7899 

  • Newbie
  • Group: Members
  • Posts: 15
  • Joined: 02-January 13
  • OS:Windows 7 x86
  • Country: Country Flag

Posted 17 February 2013 - 10:38 AM

View Postjaclaz, on 02 January 2013 - 02:27 PM, said:

View PostDataCracker7899, on 02 January 2013 - 12:06 PM, said:

easy
you can change blue text.


Perfect. :thumbup

OP:

View PostHØLLØW, on 14 February 2010 - 04:47 PM, said:

Is it also possible to clear just one line in a ECHO-command in batch?
With CLS I always clear the whole screen...


What you are suggesting is NOT about having blinking text, but rather about cyclically clear and re-display the whole console text area.

jaclaz


No you cant have cls command on one line sorry.

#13 User is offline   DataCracker7899 

  • Newbie
  • Group: Members
  • Posts: 15
  • Joined: 02-January 13
  • OS:Windows 7 x86
  • Country: Country Flag

Posted 17 February 2013 - 10:40 AM

View PostPonch, on 15 January 2013 - 03:04 PM, said:

and it's an old thread as well, I know everybody can get caught :rolleyes: but DataCracker is like looking for them. :D


What do you mean what is DataCracker7899 looking for?

#14 User is online   jaclaz 

  • The Finder
  • Group: Developers
  • Posts: 11,436
  • Joined: 23-July 04
  • OS:none specified
  • Country: Country Flag

Posted 17 February 2013 - 10:42 AM

View PostDataCracker7899, on 17 February 2013 - 10:36 AM, said:

That is very easy here is the code

Interesting you managed to worsen your own code, posted only a couple posts before:
http://www.msfn.org/...ost__p__1025209
by removing the ping loop.

And AGAIN that has NOTHING to do with "blinking" text, it is all about endless looping the CLS and ECHO commands. :realmad:

jaclaz

#15 User is offline   DataCracker7899 

  • Newbie
  • Group: Members
  • Posts: 15
  • Joined: 02-January 13
  • OS:Windows 7 x86
  • Country: Country Flag

Posted 18 February 2013 - 12:41 PM

yeah but the text will blink so so what jaclaz

#16 User is online   jaclaz 

  • The Finder
  • Group: Developers
  • Posts: 11,436
  • Joined: 23-July 04
  • OS:none specified
  • Country: Country Flag

Posted 18 February 2013 - 01:53 PM

View PostDataCracker7899, on 18 February 2013 - 12:41 PM, said:

yeah but the text will blink so so what jaclaz

No, the text won't "blink" THE WHOLE page will disappear (CLS) and then re-appear (ECHO) (and thus ALL the text on the page will appear to blink).

If you had actually READ the OP question it is about "managing" SINGLE lines and NOT the whole screen and he actually excluded in his post the use of CLS.

So you posted TWICE the same thing, BOTH times answering *another thing* from what was originally asked.

Check this page:
http://www.robvanderwoude.com/ansi.php
(already provided) if you scroll a bit down it you will see an example of ANSI <Esc>[5m under DOS.

jaclaz

#17 User is online   allen2 

  • Not really Newbie
  • PipPipPipPipPipPipPip
  • Group: Members
  • Posts: 1,736
  • Joined: 13-January 06

Posted 18 February 2013 - 02:02 PM

The dos blinking isn't cleaning the window and rewrite it entirely and that's what wanted the OP in recent windows and this was already clearly explained 3 years ago.
Edit: Jaclaz already answered more precisely.

This post has been edited by allen2: 18 February 2013 - 02:03 PM


#18 User is offline   Yzöwl 

  • Wise Owl
  • Group: Super Moderator
  • Posts: 4,364
  • Joined: 13-October 04
  • OS:Windows 7 x64

Posted 18 February 2013 - 03:10 PM

Did anyone actually take a look at the example I provided?
it provided a method of changing text on a line without clearing the screen

#19 User is online   allen2 

  • Not really Newbie
  • PipPipPipPipPipPipPip
  • Group: Members
  • Posts: 1,736
  • Joined: 13-January 06

Posted 18 February 2013 - 04:50 PM

Indeed your code is a better approach of a replacement of the dos blinking escape code but it is still far too complex to be used easily in any script.

#20 User is offline   5eraph 

  • Update Packrat
  • Group: Supreme Sponsor
  • Posts: 954
  • Joined: 04-July 05
  • OS:XP Pro x64
  • Country: Country Flag

Posted 18 February 2013 - 06:13 PM

It's not terribly difficult, allen2. Of course it will only work on the last output line. And, as written, only for a limited amount of time.

Clever way to get a carriage return, BTW. ;)

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users



All trademarks mentioned on this page are the property of their respective owners
Copyright © 2001 - 2013 msfn.org
Privacy Policy