Posted by LeeBinder

Auto-Update TeamviewerQS (QuickSupport) - my scripts for Mac & Windows :)

Both scripts download to user folder Downloads!

macOS - tested in High Sierra 10.13.6
Update & run TeamViewerQS.command
built date:
2019-08-10 - 1

echo ====================================
echo "Update & run TeamViewer Quicksupport"
echo ====================================
echo ""
echo "Please wait a moment.."
echo ""


cd ~/Downloads
Local=$(wc -c < $LocalFile)
Remote=$(curl -sI $RemoteFile | awk '/Content-Length/ {sub("\r",""); print $2}')
if [ $Local != $Remote ]; then
#curl -o ~/Downloads/TeamViewerQS.dmg ''
curl -o $LocalFile $RemoteFile
echo ""
echo "$LocalFile exists and is same size as on server."
echo ""

hdiutil attach TeamViewerQS.dmg

osascript -e 'tell application "Terminal" to set miniaturized of every window to true'
#osascript -e 'tell application "Terminal" to set visible of front window to false'
#osascript -e 'tell application "System Events" to click (first button of (every window of (application process "Terminal")) whose role description is "minimize button")'


eject () {
/usr/sbin/diskutil eject $(df | grep $1 | awk '{print $1}' | sed 's/\/dev\///')

diskutil unmountDisk force /Volumes/TeamViewerQS

#eject /Volumes/TeamViewerQS

osascript -e 'tell app "Terminal"' -e 'close (every window whose name contains ".command")' -e 'if number of windows = 0 then quit' -e 'end tell' & exit;

Windows - tested in Windows 10 1903 64bit
For now based on wget.exe whose download is facilitated by the script.
(planning to add download via cUrl for Windows 10 >= build 17063 which contains curl.exe)
Update and run TeamViewerQS.bat
built date: 2019-08-10 - 1

@echo off
echo ===========================
echo Update and run TeamViewerQS
echo ===========================

if exist %windir%\System32\wget.exe goto runWget
:: Elevate.cmd - Version 4
:: Automatically check & get admin rights
:: see "" for description

 setlocal DisableDelayedExpansion
 set cmdInvoke=1
 set winSysFolder=System32
 set "batchPath=%~0"
 for %%k in (%0) do set batchName=%%~nk
 set "vbsGetPrivileges=%temp%\OEgetPriv_%batchName%.vbs"
 setlocal EnableDelayedExpansion

  if '%errorlevel%' == '0' ( goto gotPrivileges ) else ( goto getPrivileges )

  if '%1'=='ELEV' (echo ELEV & shift /1 & goto gotPrivileges)
  ECHO **************************************
  ECHO Invoking UAC for Privilege Escalation
  ECHO **************************************

  ECHO Set UAC = CreateObject^("Shell.Application"^) > "%vbsGetPrivileges%"
  ECHO args = "ELEV " >> "%vbsGetPrivileges%"
  ECHO For Each strArg in WScript.Arguments >> "%vbsGetPrivileges%"
  ECHO args = args ^& strArg ^& " "  >> "%vbsGetPrivileges%"
  ECHO Next >> "%vbsGetPrivileges%"

  if '%cmdInvoke%'=='1' goto InvokeCmd 

  ECHO UAC.ShellExecute "!batchPath!", args, "", "runas", 1 >> "%vbsGetPrivileges%"
  goto ExecElevation

  ECHO args = "/c """ + "!batchPath!" + """ " + args >> "%vbsGetPrivileges%"
  ECHO UAC.ShellExecute "%SystemRoot%\%winSysFolder%\cmd.exe", args, "", "runas", 1 >> "%vbsGetPrivileges%"

 "%SystemRoot%\%winSysFolder%\WScript.exe" "%vbsGetPrivileges%" %*
 exit /B

 setlocal & cd /d %~dp0
 if '%1'=='ELEV' (del "%vbsGetPrivileges%" 1>nul 2>nul  &  shift /1)

REM Everything below runs elevated ("as admin")

echo This script requires Wget to update Teamviewer QS. It was not found in %windir%\System32.
echo Your default Internet Browser will open next. Please download the latest EXE
echo version for your Windows - most likely 64bit, but if you're unsure 32bit -
echo to your DOWNLOADS folder. This script will then proceed automatically.
rem echo Once you've done that, you NEED to return to this Window (for example by minimizing or closing your Browser)!

rem start iexplore ""
rem explorer ""
rem start /max
rundll32 url.dll,FileProtocolHandler
echo Waiting now patiently for wget.exe to appear in your Downloads folder...
rem pause
timeout 2 /NOBREAK
if not exist %userprofile%\Downloads\wget.exe goto waitForWgetLoop
move %userprofile%\Downloads\wget.exe %windir%\System32\

rem cd /d %~dp0
rem cd /D %systemdrive%%homepath%\Downloads
rem cd /D %HOMEDRIVE%%homepath%\Downloads
cd /D %userprofile%\Downloads

rem wget --spider -S
rem wget --no-check-certificate -O TeamViewerQS.exe
rem wget -N

wget -N --no-check-certificate

start "" TeamViewerQS.exe


2 Replies
2 Replies
Posted by CodePrime8

Re: Auto-Update TeamviewerQS (QuickSupport) - my scripts for Mac & Windows :)

Wget is not a command in native windows. I would suggest using powershell to run a scripted update.
Posted by LeeBinder

Re: Auto-Update TeamviewerQS (QuickSupport) - my scripts for Mac & Windows :)

Yes, thanks. I don't know Powerscript. I added a link regarding Wget in my posting above.