0

I have created a server-client system that links my Windows 10 to a virtual machine (XP 32bit) to handle a legacy program.

I haven't got the source code of the program. I have redirected the output of the program on a text file, from where I also give the input to the program.

The program runs on the command prompt. Some functions of the program need inputs like F1. How can I pass input from java?

Themelis
  • 4,048
  • 2
  • 21
  • 45
  • 1
    That hardly depends on this legacy program, how keyboard input is processed. You can redirect input to external program that was started from Java https://stackoverflow.com/questions/3240704/execute-external-program-using-processbuilder-and-provide-input . – PeterMmm Nov 18 '19 at 12:05
  • How are you launching the program? Is it being launched within the java application itself? How do you know that the application is listening to the file for input? – BeUndead Nov 18 '19 at 12:05
  • I start the legacy program from the prompt (of XP) with something like this: java Server|PREV(legacy program) >elaborazion.txt(file where I redirect the output).Java Server is a socket linked with the client. I start the client from Win10, the client give me the possibility to use the program from localhost, and from there I give inputs. From there I can write a string like "F1". – Oskar Czerwinski Nov 18 '19 at 12:09
  • Thank you, Peter , I will try something like that. Nevertheless if someone have other advices, I will pleased – Oskar Czerwinski Nov 18 '19 at 12:16

0 Answers0