I have been trying to figure out how to get a list of computers and their team viewer IDs. At this point I have a file with computer names. The Batch file I started trying to write looks at that list of names creates a bridge to my machine then reports back the hostname and Teamviewer CLientID. The problem is that we have different versions of teamviewer installed and the location is not the same. When I run my batch file as it is it will give me teamviewer 7 CLientIDs but thats it. As this is my first batch file any help is greatly appreciated!
::Creates .txt file with hostname and Teamviewer ClientID on network location.
call net use x: \server\location (Password) /user:(UserName)
call hostname >> x:\TeamviewerID.txt
for /f "tokens=3" %%a in ('reg query HKLM\Software\Wow6432Node\TeamViewer\Version7 /v ClientID') do (set /a num = %%a) if %ERRORLEVEL% EQU 0 GOTO Print ELSE GOTO EIGHT
:EIGHT for /f "tokens=3" %%a in ('reg query "HKLM\Software\Wow6432Node\TeamViewer\Version8 /v ClientID"') do (set /a num = %%a) if %ERRORLEVEL% EQU 0 GOTO Print ELSE GOTO NINE
:NINE for /f "tokens=3" %%a in ('reg query HKLM\Software\Wow6432Node\TeamViewer /v ClientID') do (set /a num = %%a) if %ERRORLEVEL% EQU 0 GOTO Print
:Print echo Teamviewer ID is %num%>> x:\TeamviewerID.txt
call net use x: /delete
Aucun commentaire:
Enregistrer un commentaire