-2

Trying to trigger "print screen" from ubuntu that is SSH (using paramiko) to some Linux machines AND to windםws.

Does anybody know how to trigger from cmd (I can copy the result from where it is copied to using the paramiko, exe_cmd infrasturcture I've made) a print screen. Again, this is windows

Itaybz
  • 63
  • 1
  • 6

1 Answers1

0

This VB.Net simulates the Print Screen key being pressed.

Create PrintScreen.vb on the desktop.

Imports System.Runtime.InteropServices
Imports System.Windows.Forms

Public Module SendWinKey
    Const KEYEVENTF_KEYDOWN As Integer = &H0
    Const KEYEVENTF_KEYUP As Integer = &H2

    Declare Sub keybd_event Lib "User32" (ByVal bVk As Byte, ByVal bScan As Byte, ByVal dwFlags As UInteger, ByVal dwExtraInfo As UInteger)

Public Sub Main()    
        keybd_event(CByte(Keys.PrintScreen), 0, KEYEVENTF_KEYDOWN, 0) 'press the print screen key down
        keybd_event(CByte(Keys.PrintScreen), 0, KEYEVENTF_KEYUP, 0) 'release the print screen key
End Sub

End Module

Then type

C:\Windows\Microsoft.NET\Framework\v4.0.30319\vbc "%userprofile%\desktop\PrintScreen.vb" /out:"%userprofile%\Desktop\PrintScreen.exe" /target:winexe
CatCat
  • 483
  • 4
  • 5