Update: UltraVNC 1.4.3.6 and UltraVNC SC 1.4.3.6: https://forum.uvnc.com/viewtopic.php?t=37885
Important: Please update to latest version before to create a reply, a topic or an issue: https://forum.uvnc.com/viewtopic.php?t=37864

Join us on social networks and share our announcements:
- Website: https://uvnc.com/
- GitHub: https://github.com/ultravnc
- Mastodon: https://mastodon.social/@ultravnc
- Facebook: https://www.facebook.com/ultravnc1
- X/Twitter: https://x.com/ultravnc1
- Reddit community: https://www.reddit.com/r/ultravnc
- OpenHub: https://openhub.net/p/ultravnc

Create ID with repeater... How to assign the server an ID???

Single Click discussions / bugs
Post Reply
Hickory420
8
8
Posts: 17
Joined: 2007-08-10 05:53

Create ID with repeater... How to assign the server an ID???

Post by Hickory420 »

Hi there,
I understand how everything works and what I have to do, but the Only thing I can't find any information on is: How to create an ID with the repeater and how to assign ID's to the clients (server)... :shock:

And for anyone interested, I have written a script that copies the winvncsc.exe (using the online creator) to the host machine and launches it, then it launches my vnc viewer connecting to the specified IP. When I close the viewer, it kills and deletes the processes and files.

Note: This is written for a local area network (Works best in a domain environment). Also uses a couple of "PsTools".

Code: Select all

@echo off
Title Ultr@VNC Single Click...
:start
set /p pc=Computer you wish to control: 
echo Pinging %pc%...
set usr=domain\username
set pwd=password
ping %pc% -n 2 -w 500 | find /I "Reply from" >NUL
If ErrorLevel 1 goto noping
psexec \\%pc% -u %usr% -p %pwd% -d -n 3 -c ultravncsc.exe
call "C:\Program Files\UltraVNC\vncviewer.exe" -connect %pc%::5500 -proxy 192.168.20.56::5901 -noregistry
@echo Close the VNC connection
pause
goto Done
:noping
cls
@echo.
@echo Can not Ping Host...
@echo.
goto start
:Done
pskill -t \\%pc% -u %usr% -p %pwd% ultravncsc.exe
psexec \\%pc% -u %usr% -p %pwd% del c:\windows\system32\ultravncsc.exe
pause
YY
200
200
Posts: 996
Joined: 2006-11-13 15:11

Re: Create ID with repeater... How to assign the server an I

Post by YY »

Hickory420 wrote:How to create an ID with the repeater
The syntax for viewer cmdline is:
vncviewer.exe -proxy repeater_ip::5901 ID:xxxx

Reference Redge's [topic=3173]vncviewer + SingleClick command line repeater mode II[/topic]


Hickory420 wrote:how to assign ID's to the clients (server).
But the ID in SC.exe is hard coded inside the helpdesk.txt, so basically it can't be dynamic setted at run time
Hickory420
8
8
Posts: 17
Joined: 2007-08-10 05:53

Re: Create ID with repeater... How to assign the server an I

Post by Hickory420 »

Thank You very much for that. Now I get it.
Reference Redge's vncviewer + SingleClick command line repeater mode II
I read that before, but I didn't quite understand it. But now I do.

I Juse got back from a long drive over the weekend (FUN!) so I will give it another try at work and let you know how it went.

(do you think my batch file is any good, or does anyone have any suggestions as to how it could be improved?)

Thanks Heaps!!!!!!!
Hickory420
8
8
Posts: 17
Joined: 2007-08-10 05:53

Re: Create ID with repeater... How to assign the server an I

Post by Hickory420 »

Hi Guys!
Well I got farther than normal.
Version 107
socket() initialized
bind() succeded to port 5901
listen() succeded
socket() initialized
bind() succeded to port 5500
listen() succeded
Server added to list 420
accept() connection
Viewer added to list 420
connection closed by peer
Server Removed from list 420
Viewer removed from list 420
As soon as I connect, the server drops out. Why? :surprise: (420 is the ID i am using). I'm assuming the 'peer' is the server.

My Helpdesk.txt:

Code: Select all

[TITLE]
           Need Help?

[DIRECT]

[HOST]
Helpdesk Support
-ID 420 -connect 192.168.20.56::5500 -noregistry 

[BALLOON1TITLE]
Establishing connection ...
And this is the updated version of my batch file:

Code: Select all

@echo off
Title Ultr@VNC Single Click...
:start
set /p pc=Computer you wish to control: 
echo Pinging %pc%...
set usr=domain\username
set pwd=password
ping %pc% -n 2 -w 500 | find /I "Reply from" >NUL
If ErrorLevel 1 goto noping
psexec \\%pc% -u %usr% -p %pwd% -d -c ultravncsc.exe
call "C:\Program Files\UltraVNC\vncviewer.exe" ID:420 -proxy 192.168.20.56::5901
@echo Close the VNC connection
pause
goto Done
:noping
cls
@echo.
@echo Can not Ping Host...
@echo.
goto start
:Done
pskill -t \\%pc% -u %usr% -p %pwd% ultravncsc.exe
psexec \\%pc% -u %usr% -p %pwd% del c:\windows\system32\ultravncsc.exe
pause
Anyone have any ideas??? Please help, I really need to get this working... the sooner the better.

Thank you again for all your help so far.
Hickory420
8
8
Posts: 17
Joined: 2007-08-10 05:53

Re: Create ID with repeater... How to assign the server an I

Post by Hickory420 »

Well, while I am struggling to get the above problem fixed, I thought I would share another script that I have written that remotely installs the vnc server as a service (in case you get disconnected, just run the viewer again) and when you are done, all you have to do is close the connection to the server and it will automatically, silently, uninstall vnc and service. The only thing is that a message will appear (server side) when you uninstall it, saying: The UltraVNC service has been successfully removed (or something like that.)

The only downside is that it takes a couple of minutes to copy all the setup files and install (which is why I looked into SC)

This script consists of Several Files!! And uses PsExec!

This script was written in a LAN domain environment. Everything in the script works for me. You may have to change some things around. If you publish/post/copy (you know what I mean) this script, or any of the above scripts, here or elsewhere, please give credit where credit is due! That's all I'm asking.

Cheers,
Hickory420


PushVNC.bat

Code: Select all

@echo off
Title Install VNC Remotely -- (C) Hickory420
:start
set /p pc=Computer you wish to control: 
@echo Remove only?
set /p choice=(Y)es or (Press ENTER for No): 
ping %pc% -n 2 -w 500 | find /I "Reply from" >NUL
If ErrorLevel 1 goto noping
set prog="C:\Program Files\UltraVNC"
set adsh="c$\Program Files\UltraVNC"
set usr=domain\username
set pwd=password
set dir="\\Location\of\Batch\Files"
if '%choice%'=='y' goto clean
md \\%pc%\%adsh%\
@echo.
@echo.
@echo Copying setup files... This may take a while
If Not Exist \\%pc%\%adsh%\UltraVNC-102-Setup.exe copy %dir%\UltraVNC-102-Setup.exe \\%pc%\%adsh%|call %dir%\cmds\savetime.cmd
@echo.
@echo.
@echo Installing... This may also take a while.
psexec -u %usr% -p %pwd% \\%pc% %prog%\UltraVNC-102-Setup.exe /loadinf=%prog%\vncinf.inf /verysilent
@echo.
@echo.
%prog%\vncviewer.exe -connect %pc%
:clean
@echo.
@echo To Uninstall
Pause
@echo Uninstalling...
@echo.
@echo.
psexec -u %usr% -p %pwd% \\%pc% %prog%\unins000.exe /SILENT
@echo.
@echo.
@echo Deleting all copied files + Prog Dir...
rd /q /s \\%pc%\%adsh%\
pause
GoTo Done
:noping
cls
@echo Can not Ping Host. Try Another.
goto start
:Done
SaveTime.cmd

Code: Select all

@echo off
@echo.
@echo.
@echo Copying the small files...
If Not Exist \\%pc%\%adsh%\vncinf.inf copy %dir%\vncinf.inf \\%pc%\%adsh%
If Not Exist \\%pc%\%adsh%\vncfull.reg copy %dir%\vncfull.reg \\%pc%\%adsh%
@echo.
@echo.
@echo Registering...
psexec -u %usr% -p %pwd% \\%pc% reg import %prog%\vncfull.reg
@echo.
@echo.
That was the batch file side....
Here is the content of the vncinf.inf

Code: Select all


[Setup]
Lang=en
Dir=C:\Program Files\UltraVNC
Group=UltraVNC
NoIcons=1
Components=server,server\driver
Tasks=installservice,startservice,associate

Here is the vncfull.reg

Code: Select all


Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\ORL]

[HKEY_LOCAL_MACHINE\SOFTWARE\ORL\WinVNC3]
"DebugMode"=dword:00000000
"DebugLevel"=dword:00000000
"AllowLoopback"=dword:00000000
"LoopbackOnly"=dword:00000000
"DisableTrayIcon"=dword:00000001
"MSLogonRequired"=dword:00000001
"NewMSLogon"=dword:00000000
"UseDSMPlugin"=dword:00000000
"ConnectPriority"=dword:00000001
"DSMPlugin"=hex:00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
  00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
  00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
  00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
  00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
  00,00,00,00,00,00,00,10,55,3d,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
  00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
  00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
  00,00,00,00,00,00,00,00,00,00,00,00,01,00,00,00,00,00,00,00,00,00,00,00,00,\
  00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,20,c5,4b,00,00,00,\
  00,00,40,36,49,00,00,00,00,00

[HKEY_LOCAL_MACHINE\SOFTWARE\ORL\WinVNC3\Default]
"FileTransferEnabled"=dword:00000001
"FTUserImpersonation"=dword:00000001
"BlankMonitorEnabled"=dword:00000001
"CaptureAlphaBlending"=dword:00000000
"BlackAlphaBlending"=dword:00000000
"DefaultScale"=dword:00000001
"UseDSMPlugin"=dword:00000000
"DSMPlugin"=hex:00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
  00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
  00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
  00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
  00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
  00,00,00,00,00,00,00,10,55,3d,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
  00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
  00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
  00,00,00,00,00,00,00,00,00,00,00,00,01,00,00,00,00,00,00,00,00,00,00,00,00,\
  00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,20,c5,4b,00,00,00,\
  00,00,40,36,49,00,00,00,00,00
"SocketConnect"=dword:00000001
"HTTPConnect"=dword:00000001
"XDMCPConnect"=dword:00000000
"AutoPortSelect"=dword:00000001
"InputsEnabled"=dword:00000001
"LocalInputsDisabled"=dword:00000000
"IdleTimeout"=dword:00000000
"QuerySetting"=dword:00000002
"QueryTimeout"=dword:0000000a
"QueryAccept"=dword:00000000
"LockSetting"=dword:00000000
"RemoveWallpaper"=dword:00000001
"Password"=hex:69,8d,1b,19,f7,d3,35,1e
"AllowShutdown"=dword:00000000
"AllowProperties"=dword:00000001
"AllowEditClients"=dword:00000001


[HKEY_LOCAL_MACHINE\SOFTWARE\UltraVnc]

[HKEY_LOCAL_MACHINE\SOFTWARE\UltraVnc\mslogon]
"group1"=hex:44,6f,6d,61,69,6e,20,41,64,6d,69,6e,73,00,00,00,00,00,00,00,00,00,\
  00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,01,00,00,00,00,00,00,\
  00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
  20,c5,4b,00,00,00,00,00,40,36,49,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
  00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
  00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
  00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
  00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
  00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
  00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
  00,00,00,00,00,00,00
"group2"=hex:43,65,6e,74,61,75,72,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
  00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
  00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
  00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
  00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
  00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
  00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
  00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
  00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
  00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
  00,00,00,00,00,00,00
"group3"=hex:00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
  00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
  00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
  00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
  00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
  00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
  00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
  00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
  00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
  00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
  00,00,00,00,00,00,00
"locdom1"=dword:00000002
"locdom2"=dword:00000002
"locdom3"=dword:00000000

Well, that's about it. If you have some brain power, then you can make this work for you. But if you are really really stuck, the just leave me a PM or a message here and I will do my best to help you out.

I obviously have no brain power for my problem above....

:surprise:
Hickory420
8
8
Posts: 17
Joined: 2007-08-10 05:53

Re: Create ID with repeater... How to assign the server an I

Post by Hickory420 »

Hi guys... well this thread has been pretty quiet... Is there any one who can help me please?

I use a script that copies the ultravncsc.exe onto the client machine, remotely execute the program (using psexec) and then the script launches my vncviewer, but then when connect to the repeater, I get:

Version 107
socket() initialized
bind() succeded to port 5901
listen() succeded
socket() initialized
bind() succeded to port 5500
listen() succeded
Server added to list 420 <----good
accept() connection <----good
Viewer added to list 420 <----good
connection closed by peer <-----?????
Server Removed from list 420 <-----?????
Viewer removed from list 420 <-----?????

Anyone please help me, I'm going nuts with this!!!

Thank you in advance.
Hickory420
YY
200
200
Posts: 996
Joined: 2006-11-13 15:11

Re: Create ID with repeater... How to assign the server an I

Post by YY »

For my understanding, SC can work properly only if the Active Desktop is operating under the user a/c that running the SC.

For example, if SC has established an connection, so that the remote viewer can see the desktop. In this moment, if someone (at the pc that SC running) switches to another user account, then the connection will be dropped/freezed. No more desktop screen will be sent to the remote viewer, even the SC is stilling running in the background.

I guess this is your situation. You may do an experiment to prove this.
1. Have someone to help login the pc you want to connect, WITH THE SAME user account that you used in the psexec script.
2. Run you batch script to see if you can make it work under this condition.


Fianlly, if you have the admintrative a/c of the remote computer, why not using the Windows buildin Remote Desktop?
Hickory420
8
8
Posts: 17
Joined: 2007-08-10 05:53

Re: Create ID with repeater... How to assign the server an I

Post by Hickory420 »

Legend! Genius! Guru! Thank you so much!
It works, it now works!!!!
The problem was I hadn't put the proper arguments/switches in the PsExec command!!!!! DUH!!!!! Silly Me... :P

I will post the "psexec /?" command so you can see what the arguments are and I will post my *FIXED & Up To Date Script*
PsExec v1.82 - Execute processes remotely
Copyright (C) 2001-2007 Mark Russinovich
Sysinternals - www.sysinternals.com

PsExec executes a program on a remote system, where remotely executed console
applications execute interactively.

Usage: psexec [\\computer[,computer2[,...] | @file][-u user [-p psswd]][-n s][-l][-s|
-e][-x][-i [session]][-c [-f|-v]][-w directory][-d][-<priority>][-a n,n,...] cmd [arg
uments]
-a Separate processors on which the application can run with
commas where 1 is the lowest numbered CPU. For example,
to run the application on CPU 2 and CPU 4, enter:
"-a 2,4"
-c Copy the specified program to the remote system for
execution. If you omit this option the application
must be in the system path on the remote system.
-d Don't wait for process to terminate (non-interactive).
-e Does not load the specified account's profile.
-f Copy the specified program even if the file already
exists on the remote system.
-i Run the program so that it interacts with the desktop of the
specified session on the remote system. If no session is
specified the process runs in the console session.
-l Run process as limited user (strips the Administrators group
and allows only privileges assigned to the Users group).
On Windows Vista the process runs with Low Integrity.
-n Specifies timeout in seconds connecting to remote computers.
-p Specifies optional password for user name. If you omit this
you will be prompted to enter a hidden password.
-s Run the remote process in the System account.
-u Specifies optional user name for login to remote
computer.
-v Copy the specified file only if it has a higher version number
or is newer on than the one on the remote system.
-w Set the working directory of the process (relative to
remote computer).
-x Display the UI on the Winlogon secure desktop (local system
only).
-priority Specifies -low, -belownormal, -abovenormal, -high or
-realtime to run the process at a different priority.
computer Direct PsExec to run the application on the remote
computer or computers specified. If you omit the computer
name PsExec runs the application on the local system,
and if you specify a wildcard (\\*), PsExec runs the
command on all computers in the current domain.
@file PsExec will execute the command on each of the computers listed
in the file.
program Name of application to execute.
arguments Arguments to pass (note that file paths must be
absolute paths on the target system).

You can enclose applications that have spaces in their name with
quotation marks e.g. psexec \\marklap "c:\long name app.exe".
Input is only passed to the remote system when you press the enter
key, and typing Ctrl-C terminates the remote process.

If you omit a user name the process will run in the context of your
account on the remote system, but will not have access to network
resources (because it is impersonating). Specify a valid user name
in the Domain\User syntax if the remote process requires access
to network resources or to run in a different account. Note that
the password is transmitted in clear text to the remote system.

Error codes returned by PsExec are specific to the applications you
execute, not PsExec.
And now... The New and Improved Script!!!!!!!

Code: Select all

@echo off
Title Ultr@VNC Single Click... Script written by Hickory420
:start
@echo.
set /p pc=Computer you wish to control: 
@echo.
echo Pinging %pc%...
set usr=domain\username
set pwd=password
ping %pc% -n 2 -w 500 | find /I "Reply from" >NUL
If ErrorLevel 1 goto noping
@echo --------------------------
psexec \\%pc% -u %usr% -p %pwd% -c -f -i -d ultravncsc.exe | call "C:\Program Files\UltraVNC\vncviewer.exe" ID:420 -proxy 192.168.20.56::5901
@echo --------------------------
@echo.
@echo Closing the VNC connection
goto Done
:noping
cls
@echo.
@echo Can not Ping Host...
@echo.
goto start
:Done
@echo.
@echo --------------------------
@echo.
@echo Deleting... ultravncsc.exe
del \\%pc%\C$\Windows\System32\ultravncsc.exe
@echo Done
pause
If you have any problems with the script or need any kind of help, send me a PM or, preferably, go to: [topic=11797][/topic]

Thank you, once again, for everything YY
Post Reply