I am receiving a input as vnc://172.16.41.101&passwd=test
What i want to do with this input is :
1. Extract the IP address.
2. Extract the password.
3. Launch vncviewer with the ip and password provided.
4. All this should this be automated, once the input is received.
extracting the ip and password is easy. then i launch the vncviewer with the ip provided, but how do i pass the password to that without prompting the user for the password ?
Without more detail provided, it's hard to answer this perfectly, e.g. to post the code / commands / configurations to achieve what I'd suggest... For instance, you'd need to specific exactly which vnc server, client, the platform for each side, etc, etc.
That said, if you can redesign how all of this works - I recommend not using a password at all!
Instead, setup an SSH Tunnel, and use key pair authentication to secure it. You can even remove any firewall exceptions for VNC when using this plan!
If you do this, not only will you not have to provide a password, but the entire VNC system will be far more secure!