Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: Batch File Q: Please Help Me!  (Read 46291 times)

0 Members and 1 Guest are viewing this topic.

Sidewinder



    Guru

    Thanked: 139
  • Experience: Familiar
  • OS: Windows 10
Re: Batch File Q: Please Help Me!
« Reply #15 on: July 27, 2005, 01:50:52 PM »
By using variable file names, one combined batch file is preferable to separate batch files.

Do the other two programs request data from the keyboard the same as rmovave or do you pass data along the command line? Do they all use the same input file or is output of one the input to the next? How do you want the programs to run, one file thru all 3 programs then start the second...or all files thru one program, then all files thru 2nd program, then all files thru 3rd program?

Let us know. 8)
The true sign of intelligence is not knowledge but imagination.

-- Albert Einstein

dosnovice

  • Guest
Re: Batch File Q: Please Help Me!
« Reply #16 on: July 27, 2005, 02:15:51 PM »
Thanks for getting back to me.  Yes, my ultimate goal is to have one batch file to run all three programs.  They go in this order:  Output from rmovave becomes input for sample.  Output from sample becomes input for int2drl and that's the end of it.  And yes, they requre prompts in the same way as rmovave. I guess it doesn't matter the batch file runs each file one by one or in chunks, whichever is easiest.  I created some new batch files using the same code you gave me for rmovave just to run as a test (these programs, especially rmovave, take a long time to do their thing).  Where I'm running into a problems is when the batch file plugs the answer.dat file back into the program to answer the prompts.  It doesn't work.  The answer.dat is created, I can call it up and look at it, but it won't plug into the program.  WHY?!!! I did everything the same. I've had two PHDs at the office look at it and they can't figure it out either.  My only though (whatever that's worth) is that it is something different about the programs (sample and int2drl). Help me sidewinder, your my only hope!
« Last Edit: July 27, 2005, 02:17:38 PM by dosnovice »

Sidewinder



    Guru

    Thanked: 139
  • Experience: Familiar
  • OS: Windows 10
Re: Batch File Q: Please Help Me!
« Reply #17 on: July 27, 2005, 02:32:41 PM »
Please post one of the batch files you wrote. All things being equal, this might be very simple.
The true sign of intelligence is not knowledge but imagination.

-- Albert Einstein

dosnovice

  • Guest
Re: Batch File Q: Please Help Me!
« Reply #18 on: July 27, 2005, 02:36:01 PM »
Here's the one for Int2drl:

@Echo off
for /f "tokens=1-2 delims=. " %%a in ('dir /b c:\sdsids\battest\*.rm5') do (
echo %%a.%%b > ansint.dat
echo %%a.mdb >> ansint.dat
echo 1 >> ansint.dat
c:\sdsids\battest\int2drl < ansint.dat
)

And here's the one for sample:

@echo off
for /f "tokens=1-2 delims=. " %%a in ('dir /b c:\sdsids\battest\*.rm') do (
echo %%a.%%b > anssam.dat
echo %%a.rm5 >> anssam.dat
echo 500 >> anssam.dat
echo 5 >> anssam.dat
c:\sdsids\battest\sample < anssam.dat
)

Sorry, I don't know how to make those code boxes you had, so the top line is cut in half.  Still, you get the idea.
« Last Edit: July 27, 2005, 02:37:37 PM by dosnovice »

Sidewinder



    Guru

    Thanked: 139
  • Experience: Familiar
  • OS: Windows 10
Re: Batch File Q: Please Help Me!
« Reply #19 on: July 27, 2005, 03:49:33 PM »
I couldn't find any syntax problems with your files, and since Sample and Int2drl get input from the keyboard, the only thing I can suggest is to follow the files. After you run rmovave where do the output files (.rm) end up? Make sure the paths on the FOR statements point to the actual location of the files. If there are no values to pass to the %%a and %%b variables the batch file will crash and burn.

Let us know how you make out. 8)
The true sign of intelligence is not knowledge but imagination.

-- Albert Einstein

dosnovice

  • Guest
Re: Batch File Q: Please Help Me!
« Reply #20 on: July 28, 2005, 09:41:42 AM »
I've checked the path and everything looks okay.  Both batch files get the files I need and create a correct answer file.  For some reason this answer.dat won't plug in answer the program prompts.  Could it be a problem with the programs I'm trying to run themselves?  The are prompted the same way as rmovave, through the keyboard.  I think I've really hit a wall here.  Any thoughts?  Anyone?

Sidewinder



    Guru

    Thanked: 139
  • Experience: Familiar
  • OS: Windows 10
Re: Batch File Q: Please Help Me!
« Reply #21 on: July 28, 2005, 10:32:48 AM »
I am also puzzled. Unless your two programs have found a whole new way to implement a keyboard interrupt then input redirection should be transparent. If you do find a solution or explanation, please post it; it should be very interesting to read.

???
The true sign of intelligence is not knowledge but imagination.

-- Albert Einstein

dosnovice

  • Guest
Re: Batch File Q: Please Help Me!
« Reply #22 on: July 28, 2005, 12:25:10 PM »
I'm completely stumped.  I think I've checked everyting and it still doesn't work.  The code is fine.  The path is fine.  The programs don't have anything different about the way they are prompted (all from the keyboard).  There is nothing I can think of to make this work.  Though, my knowledge of this kind of thing is admitedly pretty low.   ??? ???

Sidewinder



    Guru

    Thanked: 139
  • Experience: Familiar
  • OS: Windows 10
Re: Batch File Q: Please Help Me!
« Reply #23 on: July 28, 2005, 01:06:02 PM »
I found this little piece of info on the net.

Quote
A Pascal program can be made to detect the redirections using
Interrupt 21Hex, function 44Hex, subfunction 00Hex

While this does nothing to help you out, it might explain your dilema. Sample and Int2drl may not be programmed to detect the redirection. Sorry, but you just may be SOL.

:-/
The true sign of intelligence is not knowledge but imagination.

-- Albert Einstein

Octo

  • Guest
Re: Batch File Q: Please Help Me!
« Reply #24 on: June 09, 2020, 06:45:28 AM »
There's another question. I'm trying to use the same code as other programs. These programs are an example used to convert files from 500hz to 5Hz, I created a batch file as a quiz and eventually I want to include it in a batch file I have old problems.
12BET
I wrote the same code, changed the input value, changed the filter and gave the file an answer, the new name, but it did not want to use the data file to answer the program instructions because it responded very well. You have any idea, thank you again.