Author Topic: question on .bat code  (Read 3345 times)

0 Members and 1 Guest are viewing this topic.

Offline cooldogTopic starter

  • Supreme Robot
  • *****
  • Posts: 751
  • Helpful? 4
  • be nice to nerds, one day they will be your boss
question on .bat code
« on: February 26, 2008, 09:07:07 PM »
okay so i wrote this fun little code for my computer

Quote
@echo off
cls
pause
cls
echo why did the chicken cross the road...?
color 0a
pause
cls
echo any suggestions...
color 0a
pause
cls
echo to get to the other side
color 0a
pause
cls
:loop
echo hahahahahahahahahahahahahahahahahahahahahahahahahahahahahaha
color 0a
goto loop


just something fun

you see how it has pause written in it, that Makes it stop until i push a button... so is there anyway to make it pause for a certain time like 3 seconds then continue
robot will rule the world and i will be building them
-admin

favorite web sites
http://www.societyofrobots.com/
http://www.instructables.com/

Offline ed1380

  • Supreme Robot
  • *****
  • Posts: 1,478
  • Helpful? 3
Re: question on .bat code
« Reply #1 on: February 26, 2008, 10:19:20 PM »
delay? cycles, times, etc
Problems making the $50 robot circuit board?
click here. http://www.societyofrobots.com/robotforum/index.php?topic=3292.msg25198#msg25198

Offline HDL_CinC_Dragon

  • Supreme Robot
  • *****
  • Posts: 1,261
  • Helpful? 5
Re: question on .bat code
« Reply #2 on: February 26, 2008, 11:14:03 PM »
no theres no built in method for it.
look here: http://www.computerhope.com/batch.htm
United States Marine Corps
Infantry
Returns to society: 2014JAN11

Offline HDL_CinC_Dragon

  • Supreme Robot
  • *****
  • Posts: 1,261
  • Helpful? 5
Re: question on .bat code
« Reply #3 on: February 26, 2008, 11:20:56 PM »
You also dont have to do the "color 0a" more than once in the code. Once its there, its there.
add this under @echo off: "Title Really good joke" minus the quotes
United States Marine Corps
Infantry
Returns to society: 2014JAN11

Offline cooldogTopic starter

  • Supreme Robot
  • *****
  • Posts: 751
  • Helpful? 4
  • be nice to nerds, one day they will be your boss
Re: question on .bat code
« Reply #4 on: February 27, 2008, 05:58:18 AM »
Quote
ping 127.0.0.1 -n 2

i found this at
http://www.robvanderwoude.com/wait.html

it works okay for a delay but when it is delaying it shows up on screen it doesn't stay hidden any ideas
robot will rule the world and i will be building them
-admin

favorite web sites
http://www.societyofrobots.com/
http://www.instructables.com/

Offline izua

  • Supreme Robot
  • *****
  • Posts: 682
  • Helpful? 0
    • izua electronics
Re: question on .bat code
« Reply #5 on: February 27, 2008, 06:05:04 AM »
try "pause". it will wait for a keystroke.
Check out my homepage for in depth tutorials on microcontrollers and electronics.

Offline cooldogTopic starter

  • Supreme Robot
  • *****
  • Posts: 751
  • Helpful? 4
  • be nice to nerds, one day they will be your boss
Re: question on .bat code
« Reply #6 on: February 27, 2008, 07:12:14 AM »
you see how it has pause written in it, that Makes it stop until i push a button... so is there anyway to make it pause for a certain time like 3 seconds then continue
robot will rule the world and i will be building them
-admin

favorite web sites
http://www.societyofrobots.com/
http://www.instructables.com/

Offline izua

  • Supreme Robot
  • *****
  • Posts: 682
  • Helpful? 0
    • izua electronics
Re: question on .bat code
« Reply #7 on: February 27, 2008, 11:15:35 AM »
hmm, right.
Well, if you want, I can make you a little C++ program that you can run from your batch list, and you'll pass it an argument in ms - the delay.
it will look something like this:
Code: [Select]
holdon 400
echo something
holdon 2500
echo something else
Check out my homepage for in depth tutorials on microcontrollers and electronics.

Offline HDL_CinC_Dragon

  • Supreme Robot
  • *****
  • Posts: 1,261
  • Helpful? 5
Re: question on .bat code
« Reply #8 on: February 27, 2008, 05:52:53 PM »
United States Marine Corps
Infantry
Returns to society: 2014JAN11

Offline cooldogTopic starter

  • Supreme Robot
  • *****
  • Posts: 751
  • Helpful? 4
  • be nice to nerds, one day they will be your boss
Re: question on .bat code
« Reply #9 on: February 27, 2008, 07:06:44 PM »
okay so i loaded it... but can't get it to work

instead of pause i tryed
sleep 20
sleep.exe 20
sleep20

but non of them work
robot will rule the world and i will be building them
-admin

favorite web sites
http://www.societyofrobots.com/
http://www.instructables.com/

paulstreats

  • Guest
Re: question on .bat code
« Reply #10 on: February 27, 2008, 07:16:34 PM »
did you try pointing to the absolute path

c:\mydocs\mybats\sleep.exe 20

Also try running it from a command prompt directly to see if it works and any error codes, You can also try querying it this way too       sleep.exe /? usually brings up instructions if they have been programmed accordingly. Also it may be the case that if you are using xp/vista then it just might not work for you