I am creating an automation that involves launching a batch file window and pasting a value into it and then pressing enter to initiate the file. I am wondering what the best method to imitate the paste & enter commands would be. On other forms, I have seen people use the SendKeys method, but I do not see this as an option for me and I cannot manually add context menu items during interrogation of the batch file either.
Any help or examples would be appreciated, thanks.
Please provide an example of the batch file. I would suggest you just alter the bat file to take whatever you are entering as arguments that you could provide at the command line. That would be more reliable than SendKeys. You can also work with the command line through the text adapter, although I haven't seen that used in a while. I suspect that your bat file could easily be altered to accept those as parameters though.
Unfortunately, I cannot provide an example of the file as it is confidential and it is used by a multitude of users throughout the company so altering the parameters of the file itself is also beyond my capabilities. My thought process was that since the batch file is active and in focus, I should be able to use the SendKeys method to replicate the right mouse click (paste) and then pressing enter. But, there seems to be a limited number of options to interact with batch files and that this process cannot be done? Apologies for the lack of example(s).