Skip to content

Commit

Permalink
Working on windows client
Browse files Browse the repository at this point in the history
  • Loading branch information
maouw committed Nov 15, 2023
1 parent 5db322d commit 2033cdc
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions client/winviewer.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
if (($v = (Get-ChildItem -path "$env:ProgramFiles(x86)\TurboVNC", "$env:ProgramFiles\TurboVNC" -Filter "vncvewerw.bat" -Recurse -ErrorAction SilentlyContinue).FullName) -eq $null) {
Add-Type -AssemblyName System.Windows.Forms
$openFileDialog = New-Object System.Windows.Forms.OpenFileDialog
$openFileDialog.Filter = "TurboVNC Viewer (vncviewerw.bat)|vncviewerw.bat|All files (*.*)|*.*"
$result = $openFileDialog.ShowDialog()
if ($result -eq [System.Windows.Forms.DialogResult]::OK) {
$v = $openFileDialog.FileName
}
}
if ($v -eq $null) {
Write-Host "No VncViewer found."
exit
}

try {
Invoke-Expression "ssh -f -o StrictHostKeyChecking=no -L 5901:/mmfs1/home/altan/.hyakvnc/jobs/15346459/vnc/socket.uds -J [email protected] altan@g3071 sleep 10" -ErrorAction Stop | Out-Null
Start-Process $v -ArgumentList "localhost:5901" -Wait
} catch {
Write-Host "Could not connect to VNC server."
exit
}

0 comments on commit 2033cdc

Please sign in to comment.