Computer Hope

Microsoft => Microsoft Windows => Windows Server => Topic started by: scriptsean on May 26, 2010, 12:37:15 PM

Title: flashing banner + user input in batch or vbs
Post by: scriptsean on May 26, 2010, 12:37:15 PM
Hello Guru,
Is it possible to do this in batch or vbs on win2003:
When users execute the file, it will show a flashing welcome banner until users press any key, it then will go to the menu

Below is my sample code, but i got stock hope someone helps me

@echo off
:BANNER
cls
color c
echo Welcome!
sleep 1
cls
color e
echo Welcome!
sleep 1
goto :BANNER

:MENU
something.....




Title: Re: flashing banner + user input in batch or vbs
Post by: Sid on June 04, 2010, 05:48:14 AM
Hello Guru,
Is it possible to do this in batch or vbs on win2003:
When users execute the file, it will show a flashing welcome banner until users press any key, it then will go to the menu

Below is my sample code, but i got stock hope someone helps me

@echo off
:BANNER
cls
color c
echo Welcome!
sleep 1
cls
color e
echo Welcome!
sleep 1
goto :BANNER

:MENU
something.....


Sleep doesn't work in batch.

Anyway, why do you want to do this?  What purpose will it serve?

You might be able to do it using the "ping sleep work-around", but again, I don't really understand why you'd want to do this...

An explaination of the "ping sleep work-around":

Useing the ping command in the following way can effectively mimic the desired output of a "sleep" command

ping 1.1.1.1 -n 1 -w 1000

NOTES:
1.1.1.1 MUST BE AN INVALID IP ON YOUR NETWORK
The number following "-w" is the number of milliseconds to "wait", therefore 1000 = 1 second, 5000 = 5 seconds.
The "pinging 1.1.1.1 with ..." dialog still displays
Title: Re: flashing banner + user input in batch or vbs
Post by: Fleexy on June 04, 2010, 05:24:51 PM
ping 1.1.1.1 -n 1 -w 1000 > nul

will not display the "pinging 1.1.1.1 with..." part.