Skip to content

Instantly share code, notes, and snippets.

@StefanScherer
Created October 7, 2013 20:57
Show Gist options
  • Save StefanScherer/6874808 to your computer and use it in GitHub Desktop.
Save StefanScherer/6874808 to your computer and use it in GitHub Desktop.
This is a first try to uninstall cygwin before shutting down a windows packer VM.
cd /D %SystemDrive%\
rmdir /s /q "%SystemDrive%\ProgramData\Microsoft\Windows\Start Menu\Programs\cygwin"
del /F /Q C:\Users\Public\Desktop\Cygwin*
takeown /r /d y /f cygwin
icacls cygwin /t /grant Everyone:F
rmdir /s /q cygwin
rem stop sshd as late as possible
cygwin\bin\cygrunsrv -E sshd
cygwin\bin\cygrunsrv -R sshd
rem delete the remaining parts
rmdir /s /q cygwin
rem TODO close firewall on port 22
shutdown /s /t 10 /f /d p:4:1 /c \"Packer Shutdown\"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment