JSI Tip 10250. How can an administrator configure Internet Explorer on a client computer to open a Word document in Microsoft Word?

When you click on a link to a word document in Internet Explorer, the default behavior is to open the document within Internet Explorer.

I have scripted LWordIE.bat to allow an administrator to configure Internet Explorer on a client computer to open a Word document in Microsoft Word.

The syntax for running LWordIE.bat is to run LWordIE from a command prompt, with no parameters.

LWordIE.bat contains:

@echo off
setlocal EnableDelayedExpansion
set DOC=NONE
call :q1>nul 2>&1
if "%DOC%" EQU "NONE" goto err1
call :q2>nul 2>&1
call :q3>nul 2>&1
endlocal
goto :EOF
:q1
for /f "Tokens=*" %%a in ('reg query HKCR\.DOC /VE^|find "REG_SZ"') do (
 set line=%%a
 set line=!line:*REG_SZ=REG_SZ!
 for /f "Tokens=2" %%b in ('@echo !line!') do (
  set DOC=%%b
 )
)
goto :EOF
:err1
@echo Word NOT found.
endlocal
goto :EOF
:q2
for /f "Tokens=*" %%u in ('reg query HKU^|find "\"^|find /v /i "_Classes"') do (
 reg delete %%u\Software\Microsoft\Windows\Shell\AttachmentExecute\\{0002DF01-0000-0000-C000-000000000046\} /V %DOC% /F
)
goto :EOF
:q3
set /a BrowserFlags=0
for /f "Tokens=2*" %%a in ('reg query HKLM\SOFTWARE\Classes\Word.Document.8 /V BrowserFlags^|find "REG_DWORD"') do (
 set /a BrowserFlags=%%b
)
set /a BrowserFlags="BrowserFlags | 0x8"
reg add HKLM\SOFTWARE\Classes\Word.Document.8 /V BrowserFlags /T REG_DWORD /F /D %BrowserFlags%
set /a EditFlags=0
for /f "Tokens=2*" %%a in ('reg query HKLM\SOFTWARE\Classes\Word.Document.8 /V EditFlags^|find "REG_DWORD"') do (
 set /a EditFlags=%%b
)
reg add HKLM\SOFTWARE\Classes\Word.Document.8 /V EditFlags /T REG_DWORD /F /D %EditFlags%



Hide comments

Comments

  • Allowed HTML tags: <em> <strong> <blockquote> <br> <p>

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
Publish