@echo off rem Cygwin uninstallation script rem rem This script removes current mounts and restores backed up mounts. Backed rem up mounts are restored from the file %TEMP%\cygwin-mounts (if it exists). rem There must be a working Cygwin installation under %cd%\cygwin. rem rem This script is designed to undo the installation done by install.bat. set WD=%~dp0 set CYGWIN_ROOT=%WD%\cygwin set CYGWIN_BIN=%CYGWIN_ROOT%\bin rem Restore backed up mounts (if a mount backup file exist) if exist %TEMP%\cygwin-mounts ( rem Remove all user mounts %CYGWIN_BIN%\umount -U rem Remove the user cygdrive path rem The previous setting for the the cygdrive path was not saved, so leave the rem new setting intact. rem %CYGWIN_BIN%\umount -u -c rem Get POSIX path for mount command to use in backup script for /F %%A in ('%CYGWIN_BIN%\cygpath "%CYGWIN_BIN%\mount"') do set MOUNT=%%A rem Run backup script, with "mount" replaced with its full path %CYGWIN_BIN%\sed "s:mount:%MOUNT%:" %TEMP%\cygwin-mounts | %CYGWIN_BIN%\sh rem Remove backup script file del %TEMP%\cygwin-mounts )