Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @echo OFF
- setlocal
- REM This will reset LibreOffice back to the default settings.
- REM Create a shortcut to this Batch file and put it here...
- REM "%APPDATA%\Microsoft\Windows\Start Menu\Programs"
- REM It will now appear in your Start Menu.
- REM Kill LibreOffice.
- taskkill /im "soffice.bin" /f 2>nul
- REM Set the LibreOffice Folder.
- set "LOF=%APPDATA%\LibreOffice"
- REM Try to remove that folder.
- if exist "%LOF%" (
- :: http://ss64.com/nt/rd.html
- rd /s /q "%LOF%" || echo Couldn't remove the LibreOffice folder. && goto :End
- ) else (
- echo Folder not found.
- goto :End
- )
- REM Get the full Program Files path.
- set /A COUNT=0
- call :Subroutine
- REM Verify the removal.
- if exist "%LOF%" (
- echo Could not delete: %LOF%
- ) else (
- echo Deleted: %LOF%
- echo Starting LibreOffice . . .
- start "" /D "%PROGRAMFILES%\LibreOffice %COUNT%" "%PROGRAMFILES%\LibreOffice %COUNT%\program\soffice.exe" && echo Done.
- )
- :End
- endlocal
- echo Ending . . .
- timeout /t 15 /nobreak >nul
- exit 0
- :Subroutine
- if exist "%PROGRAMFILES%\LibreOffice %COUNT%" (
- exit /b 0
- )
- set /A COUNT=COUNT+1
- if %COUNT% EQU 50 (
- echo The LibreOffice path name has changed.
- goto :End
- )
- goto :Subroutine
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement