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

UVNC SC Creator (CMD-Script)

Single Click discussions / bugs
Post Reply
dmn
Posts: 1
Joined: 2009-05-15 21:26

UVNC SC Creator (CMD-Script)

Post by dmn »

I'm using UVNC excessively for many years now so finally I decided to give something back. :-D

The purpose of this little script is to provide a quick and easy way of creating UVNC SC executables.

I always wanted to use encryption for the connections but couldn't get it to work with any other UVNC SC creating tool. Playing around with the sfx folder in the UVNC-dir I found the way that finally worked for me was to let winvnc.exe create it's configuration file, modify it a little bit, pack everything a standalone UVNC Host would need to run an encrypted connection in a 7zip archive and make it into a sfx-archive.

Doing all this every time and again was getting teadious pretty early and I've always had a fable for the simplicity of cmd scripts so I decided to try my rusty batch skills once more.

Here's how to use it:

The concept of the script is pretty straight forward. Put these files with the script in some directory
- 7z.exe (to make the magic happen)
- config.txt (the 7zip sfx command file, will be created by the script if missing)
- winvnc.exe (for obvious reasons)
- ultravnc.ini (uvnc's slightly modified configuration file)
- SCHook.dll (Yes, I know, but I don't care about it's registry doings)
- MSRC4Plugin.dsm (only if you want to use encryption)
- rc4.key (your own RC4 keyfile)

Start winvnc.exe to set your password and maybe a few options if you like and use the MSRC4Plugin to create your own RC4 Keyfile. Edit the newly created ultravnc.ini and delete the config line containing the program path. Don't know if this actually matters, but it doesn't hurt either. Edit the config.txt and insert your hostname and port configuration so that it points to your VNC listening service.
After all this is done, we're ready to roll!

Assuming you have your router and firewall config set up correctly, the created SC-Host should connect to your VNC-Listener.

Hope you don't mind that I put some of the text above in the code of my script to provide a handy little built-in documentation. :roll:
This way you can call for help with cmd-line switches -? and /?

Alright, here goes:

Code: Select all

@echo off
color 1f
title UVNC SFX Maker by DMN
echo ============================
echo UltraVNC SC SFX Maker by DMN
echo ============================

rem Checking Input
if "%1"=="-?" goto sfxhelp
if "%1"=="/?" goto sfxhelp

if "%1"=="" set arc_name=VNC_%RANDOM%&echo [%time%] No filename was given, using random filename.&echo [%time%] Use UVNCSFX -? for more information.

if not "%1"=="" set arc_name=%~n1

if exist %arc_name%.* set arc_name=%arc_name%_%RANDOM%&echo [%time%] File already exists, renaming it.

rem Create SFX
echo.
if not exist 7z.exe color 0c&echo Error! 7z.exe is missing, can't do anything without it.&echo.&pause&exit
if not exist 7zip.sfx color 0c&echo Error! 7zip.sfx is missing, can't do anything without it.&echo.&pause&exit
if not exist config.txt goto createconfig

echo [%time%] Creating Archive: %arc_name%.7z

7z a %arc_name%.7z winvnc.exe SCHook.dll ultravnc.ini MSRC4Plugin.dsm rc4.key
echo.
echo [%time%] Creating SFX: %arc_name%.exe
echo.
copy /b 7zip.sfx+config.txt+%arc_name%.7z %arc_name%.exe
del %arc_name%.7z

echo.
echo [%time%] All done. Enjoy!
echo.
echo You can now send %arc_name%.exe to any friend who needs your helping hand...  ;-)
echo.
echo.
pause
exit

:createconfig
echo [%time%] Creating template 7zip config.txt
echo ;!@Install@!UTF-8!>config.txt
echo Title="UltraVnc">>config.txt
echo RunProgram="winvnc.exe -connect (your.hostname:port) -run">>config.txt
echo ;!@InstallEnd@!>>config.txt
echo 7zip config.txt created. Modify it according to your hostname and port and run
echo UVNCSFX again.

:sfxhelp
echo.
echo Usage: uvncsfx [filename]
echo.
echo Specifying a filename is optional. If you don't enter one,
echo a random one will be given.
echo.
echo How to use it:
echo --------------
echo The concept of this script is pretty straight forward.
echo First, put these files in the same direcory as this script,
echo "%~dp0" in this case.
echo - 7z.exe           (to make the magic happen)
echo - config.txt       (the 7zip sfx command file, will be created if missing)
echo - winvnc.exe       (for obvious reasons)
echo - ultravnc.ini     (uvnc's slightly modified configuration file)
echo - SCHook.dll       (Yes, I know, but I don't care about it's registry doings)
echo - MSRC4Plugin.dsm  (only if you want to use encryption)
echo - rc4.key          (your own RC4 keyfile)
echo.
echo Then, start winvnc.exe to set your password and maybe a few options if you
echo like and use the MSRC4Plugin to create your own RC4 Keyfile.
echo Edit the newly created ultravnc.ini and delete the config line containing
echo the program path. Edit config.txt and insert your hostname and port
echo configuration so that it points to your VNC listening service.
echo After all this is done, we're ready to roll! Run UVNCSFX and enjoy...
echo.
pause
echo About:
echo ------
echo The purpose of this little script is to provide an easy way of creating
echo UltraVNC Single Click (UVNC SC) executables.
echo.
echo I also wanted to use encryption for the connections but couldn't get it to
echo work with any other UVNC SC creating tool. The way that finally worked for me
echo was to let winvnc.exe create it's configuration file, modify it a little bit,
echo pack everything a standalone UVNC Host would need to run an encrypted
echo connection in a 7zip archive and make it into a sfx-archive.
echo.
echo Doing all this every time and again is getting teadious pretty early so I
echo decided to try my rusty batch skills once more.
echo.
echo I don't bother about licensing stuff or anything like that. It's a script
echo so that would be ridiculous anyway. Feel free to modify it to your likings
echo and do with it what you want.
echo.
echo.
echo =====================
echo POWER TO THE PEACEFUL
echo =====================
echo.
echo.

pause
exit
It's just a CMD script, so feel free to modify it to your likings and do with it what you want. :-D

I've tried it on a variety of computers at three different locations so it really should be working but please don't hesitate to drop a line on if and how it works out for you.

Cheers.
User avatar
JDaus
Friend of UVNC
Friend of UVNC
Posts: 537
Joined: 2007-03-17 11:00
Location: Sydney, Australia
Contact:

Re: UVNC SC Creator (CMD-Script)

Post by JDaus »

nice one ...

that's ALOT of code for a batch, so I guess you have taken some time to create it.

thanks for giving back to the community, its always good to see what others create...



I used a (much smaller and simpler) script for a few years, but recently created an autoit script that uses the 7z dll (allows for better feedback on success / failure - user gets a list of files added). its included in the scprompt2009 download (if you want to have a look)

I just zip up the whole sub-directory (custom), so anyone can include whatever they want. my latest version (still in testing) allows anyone to zip any sub-directory and then execute any file within the chosen dir (after extraction).

thanks for your contribution ... i'm sure MANY people will find this helpful. it would be good if you had a zip with the necessary files.
ask a silly question and remain a fool for 5 minutes...
don't ask, and remain a fool for life - JDaus 2003

without imperfections, neither you nor i would exist - Steven Hawkins
__
JD
SCPrompt - OpenSource Free Remote Screen\Desktop Sharing Solution
SecureTech.com.au
siva_vandanapu
8
8
Posts: 13
Joined: 2008-12-11 11:14

Re: UVNC SC Creator (CMD-Script)

Post by siva_vandanapu »

Hey, Can you please share me the latest source code. I am working for Windows 2008 compatibility.

Thanks
siva kumar V
B
800
800
Posts: 2338
Joined: 2009-09-09 14:05

Re: UVNC SC Creator (CMD-Script)

Post by B »

Siva, that first post above <b>is</b> the source code.

If you're talking about the source code for UltraVNC, it should be available off the UltraVNC web site.
siva_vandanapu
8
8
Posts: 13
Joined: 2008-12-11 11:14

Re: UVNC SC Creator (CMD-Script)

Post by siva_vandanapu »

Hi, Thanks for your reply.

I need the source code for Winvnc.exe which is part of singleclcik. There are 2 winvnc.exe's, Single click uses smaller component. Can you please provide the link / share the code for smaller component.


Thanks in advance
Siva kumar V
User avatar
supercoe
400
400
Posts: 1732
Joined: 2009-07-20 21:27
Location: Walker, MN
Contact:

Re: UVNC SC Creator (CMD-Script)

Post by supercoe »

siva_vandanapu,

Please stop double posting the same questions.

The source code for UltraVNC is available from the SVN:
http://ultravnc.svn.sourceforge.net/

The source code for SC is available on request which has been mentioned to your before.
http://www.chunkvnc.com - ChunkVNC - Free PC Remote control with the Open Source UltraVNC wrapper InstantSupport!
Post Reply