I am trying to write a PowerShell script to execute a command to open a java program. I am able to get the program to execute in CMD but not in PowerShell, thus why I want to go from PowerShell to CMD. Below is a list of the different lines that I have tried and none seem to work.
cmd.exe/c "Users\Forrest_Hunter\Documents\NetBeansProjects\ParsingEngine\src>java -classpath .;stanford-corenlp-3.8.0.jar;stanford-corenlp-3.8.0-javadoc.jar;stanford-corenlp-3.8.0-models.jar;stanford-corenlp-3.8.0-models.jar Test.TestCoreNLP"
cmd.exe/c "C:\Users\Forrest_Hunter\Documents\NetBeansProjects\ParsingEngine\src>java -classpath .;stanford-corenlp-3.8.0.jar;stanford-corenlp-3.8.0-javadoc.jar;stanford-corenlp-3.8.0-models.jar;stanford-corenlp-3.8.0-models.jar Test.TestCoreNLP"
& "C:\Users\Forrest_Hunter\Documents\NetBeansProjects\ParsingEngine\src>java -classpath .;stanford-corenlp-3.8.0.jar;stanford-corenlp-3.8.0-javadoc.jar;stanford-corenlp-3.8.0-models.jar;stanford-corenlp-3.8.0-models.jar Test.TestCoreNLP"
cmd.exe/c "C:\Users\Forrest_Hunter\Documents\NetBeansProjects\ParsingEngine\src>java -classpath .;stanford-corenlp-3.8.0.jar;stanford-corenlp-3.8.0-javadoc.jar;stanford-corenlp-3.8.0-models.jar;stanford-corenlp-3.8.0-models.jar Test.TestCoreNLP"
Start-Process '& "C:\Users\Forrest_Hunter\Documents\NetBeansProjects\ParsingEngine\src>java -classpath .;stanford-corenlp-3.8.0.jar;stanford-corenlp-3.8.0-javadoc.jar;stanford-corenlp-3.8.0-models.jar;stanford-corenlp-3.8.0-models.jar Test.TestCoreNLP"'
Invoke-Expression -Command:cmd.exe/C C:\Users\Forrest_Hunter\Documents\NetBeansProjects\ParsingEngine\src>java -classpath .;stanford-corenlp-3.8.0.jar;stanford-corenlp-3.8.0-javadoc.jar;stanford-corenlp-3.8.0-models.jar;stanford-corenlp-3.8.0-models.jar Test.TestCoreNLP
I have refered to this post in the community, Running CMD command in Powershell and https://social.technet.microsoft.com/Forums/office/en-US/7b398cea-0d29-4588-a6bc-ef793b51cc3c/run-a-dos-command-in-powershell?forum=winserverpowershell to formulate my attempted tries. Any help would be appreciated.
Thanks!