I'm using MaxiVista a lot, as well at home as at the office. It's great to be able to easily extend your desktop over the network onto an old pc, resulting in a very large screen managed with only one keyboard and mouse.
But I was facing the following problem when switching between my home environment and work environment: different IP addresses are used, resulting in MaxiVista to only function correctly when some manual configuration was updated and the PC rebooted, each time! While looking into this, I noticed the IP address of the server to connect to, was kept into the regstry key: HKEY_CURRENT_USER\Software\MaxiVista\A3\
@echo offrem stop applicationstaskkill /F /IM MaxiVistaA.exerem ping hostSET HOSTNAME=maxivistaserverhostnameSET USERNAME=usernameping -n 1 -w 1 %HOSTNAME% > %TEMP%.\ping.txtsetlocal enabledelayedexpansionset ip=set SEPARATOR=/for /f "usebackq delims=[] tokens=2" %%i in (`find "[" "%TEMP%\ping.txt"`) do (set ip=%%i)> %TEMP%.\ping.txt ECHO %ip%for /f "usebackq tokens=1,2,3,4 delims=. " %%i in (%TEMP%\ping.txt) do (reg add "HKCU\Software\MaxiVista\A3\%USERNAME%" /v "b1" /t REG_DWORD /d "%%i" /freg add "HKCU\Software\MaxiVista\A3\%USERNAME%" /v "b2" /t REG_DWORD /d "%%j" /freg add "HKCU\Software\MaxiVista\A3\%USERNAME%" /v "b3" /t REG_DWORD /d "%%k" /freg add "HKCU\Software\MaxiVista\A3\%USERNAME%" /v "b4" /t REG_DWORD /d "%%l" /f):: Delete the temporary ping fileDEL %TEMP%.\ping.txtstart "MaxiVista" "C:\Program Files\MaxiVista\MaxiVistaA.exe"@echo on
No comments:
Post a Comment