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.
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
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.