While accessing a Windows Pro VM via Remote Desktop, I can succesfully run a batch file in Powershell by navigating to the folder and running “.batchfile.bat” which contains:
"C:Program FilesInternet Exploreriexplore.exe" "https://name.of.websitein.url.com?param=xyz"
There is a ClickOnce app (associated with the Windows user for security) that is run with this batch file. The parameter launches the app silently and updates a log file with downloaded information. When it works, it opens IE, downloads a file, close IE, opens the app and runs the command, then closes the app.
If I remote into the Windows machine via SSH, the command prompt in SSH is Powershell. But if I try to run the batch file, it only shows Internet Explorer in the Task Manager. Nothing else happens and I have to end the task manually. If I do “$out = .batchfile.bat” there is no output to read.
I have attempted: all various sorts of Invoke-Command, “cmd.exe”, etc. All same results. I would like to prompt the normal behavior of the batch file if the user is logged in, or when account is locked. I am generally attempting this approach after endless failed attempts to run via Task Scheduler (Where it said it ran fine, but nothing actually happens).
How can I run the batch file remotely via SSH?