The script is ending on this line:
Code: Select all
xcopy /y /f "%wkdir%ultravnc.ini" "%wkdir%VNCultravnc.ini*"
Code: Select all
@echo On
:: The following code will make sure this is running as Administrator
(
>nul 2>&1 %__APPDIR__%net.exe session
) || (
echo Set UAC = CreateObject^("Shell.Application"^) > "%tmp%\uac.vbs"
echo UAC.ShellExecute "%~snx0", "%*", "%~sdp0", "runas", 1 >> "%tmp%\uac.vbs"
) && (
"%tmp%\uac.vbs" && exit /b
)
if exist "%tmp%\uac.vbs" del /f /q "%tmp%\uac.vbs"
:: The Above code will make sure this is running as Administrator
:: This will install UltraVNC on a PC remotely.
::
::
@echo on
Set Port=5911
set "_os=64"
if "%PROCESSOR_ARCHITECTURE%"=="x86" (if not defined PROCESSOR_ARCHITEW6432 set "_os=32")
::if %_OS%==32 echo This is a 32bit operating system
if %_OS%==64 (
echo This is a 64bit operating system
Set FileName=VNC UltraVNC_1_3_81_X64_Setup.exe
) else (
Set FileName=VNC UltraVNC_1_3_81_X86_Setup.exe
)
set wkdir=%~dp0
cd /D %wkdir%
(set lf=^
%= creates a line feed, do not alter =%
)
@echo on
setlocal EnableDelayedExpansion
::net use z: \\yourserver\sharename
::copy "z:\FolderName" "C:\TEST_BACKUP_FOLDER"
net use * /d /y
net use Z: \\192.168.168.7\Dnload\VNC
:FileCopied
set "file="
if not exist "%FileName%" (
set "file=!file!!lf! ? %FileName%"
xcopy /y /f "Z:\%FileName%" "%wkdir%"
IF NOT ERRORLEVEL 1 GOTO FileCopied)
if not exist "VNCsetup.inf" (
set "file=!file!!lf! ? VNCsetup.inf"
xcopy /y /f "\\192.168.168.7\Dnload\VNC\VNCsetup.inf" "%wkdir%"
IF NOT ERRORLEVEL 1 GOTO FileCopied)
if not exist "VNCsetup.reg" (
set "file=!file!!lf! ? VNCsetup.reg"
xcopy /y /f "\\192.168.168.7\Dnload\VNC\VNCsetup.reg" "%wkdir%"
IF NOT ERRORLEVEL 1 GOTO FileCopied)
if not exist "VNCultravnc.ini" (
set "file=!file!!lf! ? VNCultravnc.ini"
xcopy /y /f "\\192.168.168.7\Dnload\VNC\VNCultravnc.ini" "%wkdir%"
if not exist "BatchSubstitute.bat" (
set "file=!file!!lf! ? BatchSubstitute.bat"
xcopy /y /f "\\192.168.168.7\Dnload\VNC\BatchSubstitute.bat" "%wkdir%"
)
BatchSubstitute.bat "5905" !Port! VNCultravnc.ini>ultravnc.ini
IF NOT ERRORLEVEL 1 GOTO FileCopied)
if %_OS%==64 (
if not exist "SecureVNCPlugin64.dsm" (
set "file=!file!!lf! ? SecureVNCPlugin64.dsm"
xcopy /y /f "\\192.168.168.7\C\Programs\UltraVNC\SecureVNCPlugin64.dsm" "%wkdir%"
IF NOT ERRORLEVEL 1 GOTO FileCopied)
) else (
if not exist "BatchSubstitute.bat" (
set "file=!file!!lf! ? BatchSubstitute.bat"
xcopy /y /f "\\192.168.168.7\Dnload\VNC\BatchSubstitute.bat" "%wkdir%"
)
BatchSubstitute.bat "SecureVNCPlugin64" SecureVNCPlugin VNCultravnc.ini>ultravnc.ini
xcopy /y /f "%wkdir%ultravnc.ini" "%wkdir%VNCultravnc.ini*"
IF NOT ERRORLEVEL 1 GOTO FileCopied)
if not exist "20121120_Server_ClientAuth.pubkey" (
set "file=!file!!lf! ? 20121120_Server_ClientAuth.pubkey"
xcopy /y /f "\\192.168.168.7\Dnload\VNC\20121120_Server_ClientAuth.pubkey" "%wkdir%"
IF NOT ERRORLEVEL 1 GOTO FileCopied)