I have code that I was able to do in .vbs:
If GetNumlockState() = True Then
Else
set WshShell = CreateObject("WScript.Shell")
WshShell.SendKeys "{NUMLOCK}"
End If
Function GetNumlockState()
strResult = WScript.CreateObject("WScript.Shell").Exec("powershell.exe -command [console]::NumberLock").StdOut.ReadLine
If strResult = "True" Then GetNumlockState = True Else GetNumlockState = False
End Function
I would like the .cmd console window and icon not to appear when running a saved .vbs file with this code, which is visible and disappears quickly. I wish it wasn't visible. Is it possible to modify this code and rewrite it so that the .cmd console is not visible, and the whole code works the same all the time, i.e. turns on the numlock key after detecting when it is turned off? It has to be code that matches and works for .vbs for it to handle and accept this.
Unless it is possible to execute the command from poweshell somehow from a file saved in .vbs?
Will someone help me? Best regards.