0

I am trying to make my own automation software to login multiple computers at the same time,

I have created a VB.net service that uses the sendkeys function to send keys to the pc, however I cannot get the service to input these keys for the user logged on and not when I am at the windows 10 login screen,

Here is my code at the moment:

Public Class Service1

Protected Overrides Sub OnStart(ByVal args() As String)
    ' Add code here to start your service. This method should set things
    ' in motion so your service can do its work.
    Dim thread As New Thread(AddressOf maisection)
    thread.Start()

End Sub
Public Function maisection()
    Threading.Thread.Sleep(10000)
    ' Send the keystrokes
    My.Computer.Keyboard.SendKeys("22", True)

    Return True
End Function
Protected Overrides Sub OnStop()
    ' Add code here to perform any tear-down necessary to stop your service.
End Sub

End Class

I don't understand why when I install the service and start it, after 10 seconds it should type 22 but it doesn't, at the moment the service runs as LocalService and I have checked the box that says 'Allow service to interact with desktop'. I would like this service to send a username and password to log a PC on in the future, for now it is just a proof of concept.

Please could someone help?

Thanks

Nick Carlton
  • 35
  • 1
  • 4
  • The login/lock screen runs in a separate desktop that utilizes many different security measures to avoid malware interacting with it or logging your keys. Some have been able to start a [non-interactive process](https://stackoverflow.com/a/3143055) on that desktop, but have yet to succeed with an interactive one. With Windows 10 security has likely also been increased, so chances are you will not be able to do this. – Visual Vincent Apr 15 '19 at 16:14
  • More information can be found in the answers to this question: Possible duplicate of [a gui/program that runs even during the login screen in C#](https://stackoverflow.com/questions/36948111/a-gui-program-that-runs-even-during-the-login-screen-in-c-sharp) – Visual Vincent Apr 15 '19 at 16:14

0 Answers0