Saved Bookmarks
| 1. |
Solve : why it is not working?? |
|
Answer» i have this script: @echo off at the beginning, the lines that suppose to show time and date and --------- does not work, with no errors. even if i add line like echo ---------------------------- in the :menu thanksQuote @echo off Quote at the beginning, the lines that suppose to show time and date and --------- does not work, with no errors This thread looks very familiar. Feel like I got on a merry-go-round on Groundhog Day and can't get off. Actually, the lines at the beginning are NOT coded to show you the date and time as you are redirecting the echo output to a file. In fact, the echo statements work exactly as you coded them. If you want the date and time displayed on the console, lose the redirection. If you want both redirection and console output you'll need to code both outputs. I already posted in your other thread that you cannot send the same output to two different streams in the same instruction. Just guessing, but is your batch file named script? If so the reference to script in the file is a RECURSIVE transfer of control BACK to the running file. Not only can this create problems, it is not best practice. What are you trying to do? Your file has a check for the first COMMAND line parameter which skips over the redirection. Why? How did you manage to turn something so simple into a Rube Goldberg contraption? I know what you said, but i asked the creator of the script that we were talking about and he told me to add this lines. and it worked. in addition, this function redirected the echo time and date to the log file and also to the console. but now it is not working(echo time and date).i realy dont know what are you talking about.Quote from: Lwe on March 30, 2011, 08:36:02 AM but now it is not working(echo time and date). The error message is : 'script' is not recognized as an internal or external command, operable program or batch file. How do you know it doesn't work? It never runs. Use a fully qualified path to script and use the call instruction if script is a batch file. If you had explained from the beginning what script is and what it does, you wouldn't have needed two threads and countless posts for a simple question. |
|