Sign up for the ITPro Today newsletter
Stay on top of the IT universe with commentary, news analysis, how-to's, and tips delivered to your inbox daily.
March 9, 2006
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 offsetlocal EnableDelayedExpansionset DOC=NONEcall :q1>nul 2>&1if "%DOC%" EQU "NONE" goto err1call :q2>nul 2>&1call :q3>nul 2>&1endlocalgoto :EOF:q1for /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.endlocalgoto :EOF:q2for /f "Tokens=*" %%u in ('reg query HKU^|find ""^|find /v /i "_Classes"') do ( reg delete %%uSoftwareMicrosoftWindowsShellAttachmentExecute\{0002DF01-0000-0000-C000-000000000046} /V %DOC% /F)goto :EOF:q3set /a BrowserFlags=0for /f "Tokens=2*" %%a in ('reg query HKLMSOFTWAREClassesWord.Document.8 /V BrowserFlags^|find "REG_DWORD"') do ( set /a BrowserFlags=%%b)set /a BrowserFlags="BrowserFlags | 0x8"reg add HKLMSOFTWAREClassesWord.Document.8 /V BrowserFlags /T REG_DWORD /F /D %BrowserFlags%set /a EditFlags=0for /f "Tokens=2*" %%a in ('reg query HKLMSOFTWAREClassesWord.Document.8 /V EditFlags^|find "REG_DWORD"') do ( set /a EditFlags=%%b)reg add HKLMSOFTWAREClassesWord.Document.8 /V EditFlags /T REG_DWORD /F /D %EditFlags%
You May Also Like