Hi All just wondering if you can help - i need to update the registry and add some keys and dword values...this works as a .reg file to update the registry but i need it to work in a batch script
[HKEY_CURRENT_USER\Software\Policies\Microsoft\Office\11.0\Excel]
[HKEY_CURRENT_USER\Software\Policies\Microsoft\Office\11.0\Excel\Security]
[HKEY_CURRENT_USER\Software\Policies\Microsoft\Office\11.0\Excel\Security\FileValidation]
"EnableOnLoad"=dword:00000000
[HKEY_CURRENT_USER\Software\Policies\Microsoft\Office\11.0\Word]
[HKEY_CURRENT_USER\Software\Policies\Microsoft\Office\11.0\Word\Security]
[HKEY_CURRENT_USER\Software\Policies\Microsoft\Office\11.0\Word\Security\FileValidation]
"EnableOnLoad"=dword:00000000
Thanks in advance
Batch file to update regisrty
Moderator: DosItHelp
Re: Batch file to update regisrty
reg.exe can help you there.
You just have to add these
[HKEY_CURRENT_USER\Software\Policies\Microsoft\Office\11.0\Excel\Security\FileValidation]
"EnableOnLoad"=dword:00000000
[HKEY_CURRENT_USER\Software\Policies\Microsoft\Office\11.0\Word\Security\FileValidation]
"EnableOnLoad"=dword:00000000
You just have to add these
[HKEY_CURRENT_USER\Software\Policies\Microsoft\Office\11.0\Excel\Security\FileValidation]
"EnableOnLoad"=dword:00000000
[HKEY_CURRENT_USER\Software\Policies\Microsoft\Office\11.0\Word\Security\FileValidation]
"EnableOnLoad"=dword:00000000
Re: Batch file to update regisrty
thanks dude - will give it a try
Re: Batch file to update regisrty
An alternative is to use the regfile you already have - you will need admin permissions probably
Code: Select all
@echo off
regedit /s "c:\folder\myreg.reg"
Re: Batch file to update regisrty
Not tested
1.
2.
1.
Code: Select all
@echo off
::
set EXCEL=HKEY_CURRENT_USER\Software\Policies\Microsoft\Office\11.0\Excel\Security\FileValidation
set WORD=HKEY_CURRENT_USER\Software\Policies\Microsoft\Office\11.0\Word\Security\FileValidation
::
REG ADD "%WORD%" /V EnableOnLoad /T REG_DWORD /F /D 0 >nul
REG ADD "%EXCEL%" /V EnableOnLoad /T REG_DWORD /F /D 0 >nul
2.
Code: Select all
@echo off
(
echo Windows Registry Editor Version 5.00
echo.
echo [HKEY_CURRENT_USER\Software\Policies\Microsoft\Office\11.0\Excel\Security\FileValidation]
echo "EnableOnLoad"=dword:00000000
echo.
echo [HKEY_CURRENT_USER\Software\Policies\Microsoft\Office\11.0\Word\Security\FileValidation]
echo "EnableOnLoad"=dword:00000000
)>>"%Temp%.\regfile.reg"
::
Regedit /s "%Temp%.\regfile.reg" >nul
"%windir%\regedit.exe" /s "%Temp%.\regfile.reg" >nul
Del /F /Q "%Temp%.\regfile.reg" >nul