Quantcast
Channel: Forums - Recent Threads
Viewing all articles
Browse latest Browse all 30534

Kvnc Lock Local Keyboard and Mouse on Connection Script

$
0
0

Attached is a procedure that will Lock Local keyboard and mouse on connection like the old script would for winvnc. This works on Kvnc only (not to be confused with Live Connect or RDP).  below is what you'll need for the vbscript file. Copy and paste from between the code tags into notepad and save it in your Kserver.  You'll have to modify the procedure a bit to point to the vbs on your server. Enjoy...

<code>

On Error Resume Next
Set oArgs = WScript.Arguments
sCmdLine0 = WScript.Arguments.Item(0)
If LCase(sCmdLine0) = "lock" Then
    input1 = "BlockLocalInput=0"
    input2 = "BlockLocalInput=1"
Else
    input1 = "BlockLocalInput=1"
    input2 = "BlockLocalInput=0"
End If

set shell = CreateObject("WScript.Shell")
set oFile = CreateObject("Scripting.FileSystemObject")
set oExec = shell.exec("cmd /c dir c:\*Ktvn_settings.ini /s /b")
path = oExec.StdOut.ReadLine()
Set read = oFile.OpenTextFile(path, 1, False) 'forReading
original = read.ReadAll
read.close
strNewText = Replace(original, input1 , input2)
Set write = oFile.OpenTextFile(path, 2, False) 'forWriting
write.WriteLine strNewText
write.close

</code>


Viewing all articles
Browse latest Browse all 30534

Trending Articles