This script works OK, but it doesn't remember the password as supplied in the script. and therefore prompts for one when it starts... Which is it's major failing.

It wouldn't be too difficult to get this to push VNC onto other PCs, but I wanted it to work on a local client first...

dependencies: WMIService(), RegWrite(), WMI
Any ideas??

code:
break on
call \\server\share\udf.kix

dim $key[2]
$source = "\\server\share\apps\vnc"
$Destination = "%windir%\system32"
$pass="3c,52,32,57,c2,a5,21,a9"

WMIService("winvnc","STOP")
;$=deltree("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\winvnc")
$=deltree("HKEY_LOCAL_MACHINE\Software\ORL")
$=deltree("HKEY_CURRENT_USER\Software\ORL")

copy "$source\OMNITHREAD_RT.DLL" "$destination"
copy "$source\VNCHOOKS.DLL" "$destination"
copy "$source\WINVNC.EXE" "$destination"
copy "$source\VNCHooks_Settings.reg" "$destination"

regwrite("HKEY_LOCAL_MACHINE\Software\ORL\VNC\3.3.3","","")

$key[0]="HKEY_LOCAL_MACHINE\Software\ORL\WinVNC3\Default"
$key[1]="HKEY_CURRENT_USER\Software\ORL\WinVNC3"
for $loop=0 to 1
regwrite($key[$loop],"SocketConnect","1","REG_DWORD")
$=WriteValue($key[$loop],"AutoPortSelect","1","REG_DWORD")
$=WriteValue($key[$loop],"InputsEnabled","1","REG_DWORD")
$=WriteValue($key[$loop],"LocalInputsDisabled","0","REG_DWORD")
$=WriteValue($key[$loop],"IdleTimeout","0","REG_DWORD")
$=WriteValue($key[$loop],"QuerySetting","2","REG_DWORD")
$=WriteValue($key[$loop],"QueryTimeout","10","REG_DWORD")
$=WriteValue($key[$loop],"Password","$pass","REG_BINARY")
$=WriteValue($key[$loop],"PollUnderCursor","0","REG_DWORD")
$=WriteValue($key[$loop],"PollForeground","1","REG_DWORD")
$=WriteValue($key[$loop],"PollFullScreen","0","REG_DWORD")
$=WriteValue($key[$loop],"OnlyPollConsole","1","REG_DWORD")
$=WriteValue($key[$loop],"OnlyPollOnEvent","0","REG_DWORD")
$=WriteValue($key[$loop],"AllowShutdown","0","REG_DWORD")
$=WriteValue($key[$loop],"AllowConfig","0","REG_DWORD")
next

shell 'regedit -s $destination\VNCHooks_Settings.reg'
Shell "$destination\winvnc.exe -install"
WMIService("winvnc","START","Automatic")

_________________________
How to ask questions the smart way <-----------> Before you ask