Hi all.
Recently I had to create a GPO to enforce the autorun of Lync Client, but as in the company there is no standard deployed in the client PCs, I had to check if the Lync installed is either 2010 or 2013,and whether it'sx86 orx64...
Here is my CMD script. I hope it can help someone, and of course suggestions are welcome.
@ECHO OFF REM DETECT PROCESSOR ARCHITECTURE IF %PROCESSOR_ARCHITECTURE%==x86 goto x86Proc :AMD64 REM Detect Lync2010 :Lync2010Check IF EXIST "%ProgramFiles%\Microsoft Lync\communicator.exe" goto Lync2010x64exists IF EXIST "%ProgramFiles(x86)%\Microsoft Lync\communicator.exe" goto Lync2010x86exists goto Lync2013Check :Lync2010x86exists reg add HKCU\Software\Microsoft\Windows\CurrentVersion\Run /f /v Communicator /d "\"%programfiles(x86)%\Microsoft Lync\communicator.exe\" /fromrunkey" goto end :Lync2010x64exists reg add HKCU\Software\Microsoft\Windows\CurrentVersion\Run /f /v Communicator /d "\"%programfiles%\Microsoft Lync\communicator.exe\" /fromrunkey" goto end REM Detect Lync2013 :Lync2013Check if exist "%programfiles%\Microsoft Office\Office15\lync.exe" goto Lync2013x64exists if exist "%ProgramFiles(x86)%\Microsoft Office\Office15\lync.exe" goto Lync2013x86exists goto end :Lync2013x64exists reg add HKCU\Software\Microsoft\Windows\CurrentVersion\Run /f /v Lync /d "\"%programfiles%\Microsoft Office\Office15\lync.exe\" /fromrunkey" goto end :Lync2013x86exists reg add HKCU\Software\Microsoft\Windows\CurrentVersion\Run /f /v Lync /d "\"%programfiles(x86)%\Microsoft Office\Office15\lync.exe\" /fromrunkey" goto end :x86Proc REM Detect Lync2010 :Lync2010Check IF EXIST "%ProgramFiles%\Microsoft Lync\communicator.exe" goto Lync2010x86exists_1 goto Lync2013Check :Lync2010x86exists_1 reg add HKCU\Software\Microsoft\Windows\CurrentVersion\Run /f /v Communicator /d "\"%programfiles%\Microsoft Lync\communicator.exe\" /fromrunkey" goto end REM Detect Lync2013 :Lync2013Check if exist "%programfiles%\Microsoft Office\Office15\lync.exe" goto Lync2013x86exists_1 goto end :Lync2013x86exists_1 reg add HKCU\Software\Microsoft\Windows\CurrentVersion\Run /f /v Lync /d "\"%programfiles%\Microsoft Office\Office15\lync.exe\" /fromrunkey" goto end :end
Sergio Argüello Productivity Solutions Engineer Interconnect SA