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