0

I would like to write a simple script in win95 command prompt that enumerate integers and echo'es them. How can I write it?

Bonus question: is there a while loop available?

Pseudo code:

for i in (1,1,1000000) do echo i

It is surprisingly challenging since win95 is so old that I couldn't find any reliable info quickly.

Thanks

Mark
  • 3,609
  • 1
  • 22
  • 33
mak
  • 1,384
  • 1
  • 13
  • 21
  • Your example isn't counting integers. It would help to know the exact task but you will find `qbasic.exe` is the tool to use. – foxidrive Feb 16 '14 at 14:18
  • sorry, edited the question. – mak Feb 16 '14 at 14:38
  • @foxidrive Why should he want to use QBasic? He explicitly asked about the command prompt. Concerning the question: Windows 95 is not different to DOS in that respect, so you might want to have a look at the first Google match I came up with about FOR loops in DOS: http://www.robvanderwoude.com/for.php – qqilihq Feb 16 '14 at 16:13
  • I actually tried the following command which resulted in a syntax error: `FOR /L %i in (1,1,10000) DO ECHO %i` – mak Feb 16 '14 at 17:12
  • I'd also like to know why the downvote on the question? – mak Feb 16 '14 at 17:15
  • @qqilihq Win95 has no native calculation routines, apart from labourious techniques which are not mathematical in nature. Using `Qbasic` was the most common method back then. I asked the OP for more details so I could provide a native solution, if possible, but they aren't forthcoming. – foxidrive Feb 17 '14 at 09:57
  • The exact task is actually echoing integers in sequence on a cmd terminal in win95. – mak Feb 17 '14 at 20:16

1 Answers1

0

Here is a solution using MSDOS6/WIN9x techniques.

@echo off
:loop
echo z>>tmp.tmp
find /c "z" <tmp.tmp
goto :loop
foxidrive
  • 40,353
  • 10
  • 53
  • 68