Update: UltraVNC 1.4.3.6 and UltraVNC SC 1.4.3.6: viewtopic.php?t=37885
Important: Please update to latest version before to create a reply, a topic or an issue: 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://twitter.com/ultravnc1
- Reddit community: https://www.reddit.com/r/ultravnc
- OpenHub: https://openhub.net/p/ultravnc

How to mimic "Add New Client"

Post Reply
romrom3254
8
8
Posts: 9
Joined: 2015-06-01 14:22

How to mimic "Add New Client"

Post by romrom3254 »

I'm trying to create a mini-program that starts up a new session, basically an equivalent of selecting "Add new client" by right-clicking the UltraVNC server service. What is the exact command line that "Add New Client" executes? Obviously it includes winvnc -connect, etc. Does it also include the -autoreconnect command? So, to be crystal clear if I set:
Host Name = connectToMe.com
Connection Number = 21
What exact command line will be created when I hit OK?

P.S. I tried to figure it out by downloading the code, but unfortunately I'm not that savvy with C++ programming.
User avatar
Rudi De Vos
Admin & Developer
Admin & Developer
Posts: 6832
Joined: 2004-04-23 10:21
Contact:

Re: How to mimic "Add New Client"

Post by Rudi De Vos »

Try

winvnc.exe -connect viewerhost:5500 -run
winvnc" -autoreconnect -connect viewerhost:5500 -run

if port =21

you need to use viewerhost::21 ( ports lower then 1024 require a dubble : )
romrom3254
8
8
Posts: 9
Joined: 2015-06-01 14:22

Re: How to mimic "Add New Client"

Post by romrom3254 »

Sorry, but which one is it? Does "Add new client" use autoreconnect or not?
Do I need to include the ID with autoreconnect if I use the -id tag anyway?
Also, when would one use -stopreconnect ?
Documentation is, frankly, very confusing
romrom3254
8
8
Posts: 9
Joined: 2015-06-01 14:22

Re: How to mimic "Add New Client"

Post by romrom3254 »

Oops, I forgot to mention that I am using the repeater service.
The documentation doesn't really state how these commands are affected when you do repeater vs. a listening viewer.

I have a few issues with the documentation, but it could just be due to my ignorance of how UVNC works:

First, the documentation page shows the following parameters:
winvnc [-sc_promt] [-sc_exit] [-id:????] [-autoreconnect[ ID:????]] [-connect host[:port]] [-connect host[::port]] [-run]

Whereas the command "winvnc -?" tells a different story:
winvnc [-sc_promt] [-sc_exit] [-id:????] [-stopreconnect][-autoreconnect[ ID:????]] [-connect host[:display]] [-connect host[::port]] [-repeater host[:port]] [-run]

Note that the former has no mention of stopreconnect and repeater tags and excludes the word "display". Which version is correct?

How is "stopreconnect" used exactly? How can I stop the server from connnecting with autoreconnect?

How do I force a connetion closed? Kill it? I don't want to close the service for good, just the active connection.

What is the "id" tag used for? Why is there a separate id qualifier for the "autoreconnect" tag?

Also, what is the point of the "-run" tag exactly? I understand that it signals the final tag, but does it make any difference if it is ommitted?

It would be nice if there were some more examples
User avatar
Rudi De Vos
Admin & Developer
Admin & Developer
Posts: 6832
Joined: 2004-04-23 10:21
Contact:

Re: How to mimic "Add New Client"

Post by Rudi De Vos »

1) NO repeater
winvnc running as application
run
vncviewer -listen
winvnc.exe -connect localhost -run
without -run it doesn't do anything

winvnc running as service
vncviewer - listen
winvnc.exe -connect localhost -run
This give an error, winvnc is already running because the -run try to start another winvnc
winvnc.exe -connect localhost
This is correct, but in both cases the service get the injected command

winvnc.exe -autoreconnect -connect localhost
If you close the viewer, the server restart the connect
winvnc.exe -stopreconnect
This tell the service to disable the -autoreconnect
closing viewer now stop connection

Runing as service you also can add ultravnc.ini
[ultravnc]
service_commandline=-autoreconnect -connect localhost
Now the service try reconnect after reboot, no manual handling needed

2) Repeater
winvnc -> connect to repeater
vncviewer -> connect to repeater
ID: repeater link the server and viewer with the same ID
You can have multi servers with different ID waiting, the ID act as name at repeater level

vncviewer.exe -proxy repeaterip:5901 ID:12345
winvnc -id 12345 -connect repeaterip:5500
winvnc -autoreconnect ID:12345 -connect repeaterip:5500

force closed, not possible
you can only restart the service
net stop uvnc_service
net start uvnc_service
romrom3254
8
8
Posts: 9
Joined: 2015-06-01 14:22

Re: How to mimic "Add New Client"

Post by romrom3254 »

I know this is an old post, but I still didn't have any luck getting this to work and I'm revisting this after giving up a few years back. This is my issue: If I go to the host computer (where the server is), right click on the tray icon, select "Add New Client" and enter "myhostname.com" for the "Host Name" and 21 for the connection # then I'm able to connect without any issues whatsoever. However, I'm trying to mimic this functionality by calling winvnc using another application that I created (to make it easier for the user so they don't need to type in my host name every time). I'm calling the following command line from my program:
winvnc -connect myhostname.com::9177 -id:21
However this doesn't work (it just ignores me). Am I doing something wrong? If I add the tag "-run" then it tells me that another instance is already running. HELP!
Post Reply