scienceguru1.bat wrote:it gets to where it uses the
then it gives an error and the command prompt shutsdown immediatly. it think it said syntex error
there is such a thing called a vbscript if you have not already known yet. It comes with Win98 and above pre-installed, so there is no reason you can't use it for your scripting task if you are insistent on not downloading stuff. Its more "powerful" than batch and can do many things batch can't.
Code: Select all
Do While 1=1
WScript.Echo "Enter the number of seconds:"
x = WScript.StdIn.ReadLine
WScript.Echo "user input: " & x
x = x + 1
WScript.Echo "Delay start: " & Now
WScript.Sleep 60 * x
WScript.Echo "Delay end: " & Now
WScript.Echo "Would you like to use again(y|n):"
yn = WScript.StdIn.ReadLine
If LCase(yn) = "n" Then
Exit Do
End If
Loop
you don't need to use ping to simulate a time delay... you can use functions such as Lcase to change case of letters, date manipulation is also easier. for maths, vbscript supports floating point maths, which crippled batch cannot.
To run the above script, save as myscript.vbs
Code: Select all
C:\work>cscript //nologo myscript.vbs
Enter the number of seconds:
23
user input: 23
Delay start: 2011-03-20 2:49:46 PM
Delay end: 2011-03-20 2:49:47 PM
Would you like to use again(y|n):
y
Enter the number of seconds:
here's the
manual on vbscript