Welcome to FreeSoftwareServers Confluence Wiki

Default:

@ECHO OFF
CLS
setlocal ENABLEEXTENSIONS
::FreeSoftwareServers.com

set key="*0FF1CE*"
set threesixtyfivekey="O365*"
set keypath=

set arrsize=1
set arg[0]="HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall"
set arg[1]="HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall"
for /l %%n in (0,1,%arrsize%) do (
 FOR /F "tokens=* USEBACKQ" %%N IN (`REG QUERY !arg[%%n]! /f %threesixtyfivekey% /k 2^>nul`) DO (
  ECHO "%%N" | FIND /I "HKEY">Nul && (
   If %%n == 0 (
    set arch=x32
   ) ELSE (
     set arch=x64
   )
   set keypath=%%N
   goto keypathFound
  ) 
 )
 FOR /F "tokens=* USEBACKQ" %%N IN (`REG QUERY !arg[%%n]! /f %key% /k 2^>nul`) DO (
  ECHO "%%N" | FIND /I "HKEY">Nul && ( 
   If %%n == 0 (
    set arch=x32
   ) ELSE (
     set arch=x64
   ) 
   set keypath=%%N
   goto keypathFound
  ) 
 )
)
GoTo end

:keypathFound
FOR /F "skip=2 tokens=1,2* USEBACKQ" %%N IN (`reg query "%keypath%" /t REG_SZ  /v "DisplayName"`) DO (
 IF /I "%%N" == "DisplayName" (
  SET OVer=%%P%~1
  GoTo Found
 )
)

:Found
for /f "tokens=1-20 delims=abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ!@#$&*()-= " %%a in ("%OVer%") do (
   IF %%a == 64 (
     set ONum=%%b
     GoTo varset
   )
   IF %%a == 32 (
     set ONum=%%b
     GoTo varset
   )
   set ONum=%%a
)

:varset
  ::Echo Office Number: %ONum%
  ::ECHO Office Display Name:  %OVer%
  ::ECHO Software Architecture:  %arch%
::End

set batchpath="W:\IT - Information Technology\Scripts\Functions\reg_edit.cmd"
set over=15.0
IF %ONum%==365 (
 set over=16.0
)
set regtype="REG_DWORD"


::Use Tighter Spacing
call %batchpath% "HKCU\SOFTWARE\Microsoft\Office\%over%\Outlook\Preferences\" "DensitySetting" %regtype% 0

::ToDo Bar
call %batchpath% "HKCU\SOFTWARE\Microsoft\Office\%over%\Outlook\Preferences\" "PinMail" %regtype% 0

::Show As Conversations
call %batchpath% "HKCU\SOFTWARE\Microsoft\Office\%over%\Outlook\Options\Conversations\" "ConversationsOnInAllFoldersChangeNumber" %regtype% 6
call %batchpath% "HKCU\SOFTWARE\Microsoft\Office\%over%\Outlook\Setup\" "UpgradeToConversations" %regtype% 0

::People Pane
IF %over%==16.0 (
 call %batchpath% "HKCU\SOFTWARE\Microsoft\Office\Outlook\SocialConnector\" "PeoplePaneCurrentModeInspector" %regtype% 4
 call %batchpath% "HKCU\SOFTWARE\Microsoft\Office\Outlook\SocialConnector\" "PeoplePaneCurrentModeExplorer" %regtype% 4
)
IF %over%==15.0 (
 call %batchpath% "HKCU\SOFTWARE\Microsoft\Office\Outlook\SocialConnector\" "PeoplePaneModeInspector" %regtype% 4
 call %batchpath% "HKCU\SOFTWARE\Microsoft\Office\Outlook\SocialConnector\" "PeoplePaneModeExplorer" %regtype% 4
)
 %batchpath% "HKCU\SOFTWARE\Microsoft\Office\Outlook\SocialConnector\" "PeoplePaneExplorerHeight" %regtype% 230

::PAUSE

Setup:

@ECHO OFF
CLS
setlocal enableextensions enabledelayedexpansion
::FreeSoftwareServers.com

set key="*0FF1CE*"
set threesixtyfivekey="O365*"
set keypath=

set arrsize=1
set arg[0]="HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall"
set arg[1]="HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall"
for /l %%n in (0,1,%arrsize%) do (
 FOR /F "tokens=* USEBACKQ" %%N IN (`REG QUERY !arg[%%n]! /f %threesixtyfivekey% /k 2^>nul`) DO (
  ECHO "%%N" | FIND /I "HKEY">Nul && (
   If %%n == 0 (
    set arch=x32
   ) ELSE (
     set arch=x64
   )
   set keypath=%%N
   goto keypathFound
  ) 
 )
 FOR /F "tokens=* USEBACKQ" %%N IN (`REG QUERY !arg[%%n]! /f %key% /k 2^>nul`) DO (
  ECHO "%%N" | FIND /I "HKEY">Nul && ( 
   If %%n == 0 (
    set arch=x32
   ) ELSE (
     set arch=x64
   ) 
   set keypath=%%N
   goto keypathFound
  ) 
 )
)
GoTo end

:keypathFound
FOR /F "skip=2 tokens=1,2* USEBACKQ" %%N IN (`reg query "%keypath%" /t REG_SZ  /v "DisplayName"`) DO (
 IF /I "%%N" == "DisplayName" (
  SET OVer=%%P%~1
  GoTo Found
 )
)

:Found
for /f "tokens=1-20 delims=abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ!@#$&*()-= " %%a in ("%OVer%") do (
   IF %%a == 64 (
     set ONum=%%b
     GoTo varset
   )
   IF %%a == 32 (
     set ONum=%%b
     GoTo varset
   )
   set ONum=%%a
)

:varset
  ::Echo Office Number: %ONum%
  ::ECHO Office Display Name:  %OVer%
  ::ECHO Software Architecture:  %arch%
::End

set batchpath="W:\IT - Information Technology\Scripts\Functions\reg_edit.cmd"
set over=15.0
IF %ONum%==365 (
 set over=16.0
)
set regtype="REG_DWORD"

::Use Tighter Spacing
call %batchpath% "HKCU\SOFTWARE\Microsoft\Office\%over%\Outlook\Preferences\" "DensitySetting" %regtype% 1

::ToDo Bar
call %batchpath% "HKCU\SOFTWARE\Microsoft\Office\%over%\Outlook\Preferences\" "PinMail" %regtype% 2

::Show As Conversations
call %batchpath% "HKCU\SOFTWARE\Microsoft\Office\%over%\Outlook\Options\Conversations\" "ConversationsOnInAllFoldersChangeNumber" %regtype% 6
call %batchpath% "HKCU\SOFTWARE\Microsoft\Office\%over%\Outlook\Setup\" "UpgradeToConversations" %regtype% 1

::People Pane
IF %over%==16.0 (
 call %batchpath% "HKCU\SOFTWARE\Microsoft\Office\Outlook\SocialConnector\" "PeoplePaneCurrentModeInspector" %regtype% 3
 call %batchpath% "HKCU\SOFTWARE\Microsoft\Office\Outlook\SocialConnector\" "PeoplePaneCurrentModeExplorer" %regtype% 3
)
IF %over%==15.0 (
 call %batchpath% "HKCU\SOFTWARE\Microsoft\Office\Outlook\SocialConnector\" "PeoplePaneModeInspector" %regtype% 3
 call %batchpath% "HKCU\SOFTWARE\Microsoft\Office\Outlook\SocialConnector\" "PeoplePaneModeExplorer" %regtype% 3
)
 %batchpath% "HKCU\SOFTWARE\Microsoft\Office\Outlook\SocialConnector\" "PeoplePaneExplorerHeight" %regtype% 230

::PAUSE
  • No labels