| 1. |
Solve : Commands will run in dos window, but not in bat file? |
|
Answer» I'm trying to execute a dos batch file with the following commands: When I put them into a single bat file, however, they don't work. Don't work? How? (In what way don't they work? With what symptoms/messages etc?) I've only put them in batch files with the hyts_std executable by itself in one file and the trajplot and ascii2shp in the other batch file. The hyts_std returns the default request for keyboard input. The other two executables simply flash a dos window open and shut (to quickly to see anything written)Launch the batch file from the command prompt or put a pause in the script. You need to be a little more clear on what you are doing. You need to show us the code that is in the batch file and its output.Timing may be an issue. An new task can start before the output file is closed from an earlier task. If so, there NEEDS to be something that makes sure the file is ready for the next task. You may wish to use a pipe.I suggest you put a pause statement after each command. When the program pauses, open another DOS command and check to see if the files you need have actually been created. Also there is a 'DELAY.COM' command I picked up someplace years ago. Probably Norton Utilities. It will wait for X number of seconds. I us it a lot of TIMES to wait for 2-5 seconds so files will have different time stamps. Maybe the time that is showed, but also the 1/10 of seconds. This way I can enter 'DIR /OD' and I an see exactly the order the fils were created. Hope this helped Thanks very much for all the help! I've got things working now. Quote from: ErikG on February 14, 2012, 04:11:31 PM Thanks very much for all the help! I've got things working now.Would help all that find this thread later on if you would post your final solution.I needed to make sure that I was in the correct directory when running the file so I ADDED: cd c:\hysplit4\exec to the top of the three commands. |
|