1.

Solve : ms-dos command?

Answer»

I don't know how to end one of these dos commands. Can you help me?
It remains listening to COM1 port until it receives CTRL+Z or F6 code from
the device connected to COM1 port.

COPY COM1 C:\FILE.TXT
COPY COM1 CON

As my modem connected to COM1 don't SENT CTRL+Z or F6 codes, my batch stops
at this line.

In other words:
I have an EXAMPLE batch file, when i run it, it stops at the line before "ECHO OK" line so it does not show OK on the screen. It stops at "COPY COM1 C:\FILE.TXT" and remains on listening from COM1 port, indefinitely. File.txt is created with the data needed, all ok but the fact not going on to the next line.
The actual batch is:

@ECHO OFF
ECHO ATDT0742586486>COM1
PING LOCALHOST>NUL
COPY COM1 C:\FILE.TXT
ECHO OK
PAUSE
END

How can i pass to the next line "ECHO OK"?
----------
Another different question would be:
can i copy data from COM1 port directly into a system variable?I'm not 100% sure of what you need, but try this for the first. It sets up a nice infinite loop:

Code: [Select]@ECHO OFF
ECHO ATDT0742586486>COM1
PING LOCALHOST>NUL
:Loop
COPY COM1 C:\FILE.TXT
GOTO Loop
ECHO OK
PAUSE
END I tried it and it did not work even 1 loop. It stops at "COPY COM1 C:\FILE.TXT" and directs all data from the port to file.txt on and on. You can easily realise if you run:
@ECHO OFF
COPY COM1 C:\FILE.TXT
ECHO OK
PAUSE
END
and see that no OK appears on the screen.It would help if you could tell what you want to do. The command "COPY COM1 TO FILE.TXTWhen the modem detects busy tone, it sends a string to COM1 that i receive in file.txt right to that moment. This string i need to associate a system variable instead of a file, eventually.Seems to me you are missing a control program that will talk to the modem. Sending a transmission string (ECHO ATDT0742586486>COM1 ) with batch language will not work.

If memory serves, ATDT is a DIAL command, but this would need to be translated into sense bytes the modem can understand.

After you receive the data you can use something LIKE find or findstr within a for loop to set your variable.

8-)After you receive the data you can use something like find or findstr within a for loop to set your variable.
>>>Thanks but it didn't work that way, any other idea?



Discussion

No Comment Found