Monthly Archives: July 2015

#programaday : Find Teamviewer ID and email it….

Assumptions :

Sendemail program is in c:\sendemail\

IF @OSArch = ‘x86’ Then
$tv=”HKEY_LOCAL_MACHINE\SOFTWARE\TeamViewer”
Else
$tv=”HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\TeamViewer”
EndIf

Sleep(1000)
emailID($tv)

Func emailID($tv_key)
Local $file2send = “c:\2em.bat”
Local $sVar = RegRead($tv_key, “ClientID”)
$em=”c:\sendemail\sendemail.exe -f <My Email> -t <My Email> -u ” & chr(34) & ” TV on ” & @ComputerName & ” is ” & $sVar & chr(34) & ” -m ” & chr(34) & ” TV on ” & @ComputerName & ” is ” & $sVar & chr(34)
FileCreate($file2send ,$em)
; MsgBox($MB_SYSTEMMODAL, $file2send , $em)
ShellExecute($file2send)
Sleep(8000)
FileDelete($file2send)
EndFunc
; Create a file.
Func FileCreate($sFilePath, $sString)
Local $bReturn = True ; Create a variable to store a boolean value.
If FileExists($sFilePath) = 0 Then $bReturn = FileWrite($sFilePath, $sString) = 1 ; If FileWrite returned 1 this will be True otherwise False.
Return $bReturn ; Return the boolean value of either True of False, depending on the return value of FileWrite.
EndFunc ;==>FileCreate