You could do something like this. Here's (my first ever, more-or-less) powershell script (thanks github and stack overflow!) Fix up the path to the desktop file...
Write-Output "Starting JMP"
Start-Process -FilePath "jmp.exe" -ArgumentList "C:\Users\v1\Desktop\pstest.jsl"
Write-Output "Started JMP"
# https://gist.github.com/staaldraad/153ab9d26d49c387550bcb5f974f7910
# thanks @ https://gist.github.com/staaldraad
$socket = new-object System.Net.Sockets.TcpListener('0.0.0.0', 1080);
if($socket -eq $null){
exit 1;
}
$socket.start();
$client = $socket.AcceptTcpClient();
$stream = $client.GetStream();
$buffer = new-object System.Byte[] 2048;
# $file = 'c:/afile.exe';
# $fileStream = New-Object System.IO.FileStream($file, [System.IO.FileMode]'Create', [System.IO.FileAccess]'Write');
$encoding = new-object System.Text.AsciiEncoding
do
{
$rawresponse = $null;
while($stream.DataAvailable -or $rawresponse -eq $null) {
$rawresponse = $stream.Read($buffer, 0, 2048);
if ($rawresponse -gt 0) {
$response = $encoding.GetString($buffer, 0, $rawresponse)
# $fileStream.Write($buffer, 0, $read);
$response # really? that's all it takes to print to the console?
}
}
} While ($rawresponse -gt 0);
# $fileStream.Close();
$socket.Stop();
$client.close();
$stream.Dispose();
Write-Output "all done, exit in 5 seconds..."
Start-Sleep -Seconds 5
Here's a JSL script, pstest.jsl, for the Desktop...
s=socket();
s<<connect("localhost","1080");
s<<send(chartoblob("hello world!"));
s<<close();
quit();
I think this was required, but can't be sure after a couple of false starts...
Dialog from windows to allow PowerShell to open a port.
And eventually
Right-click the .PS1 script on the desktop and ->Run in PowerShell.
Craige