Everybody Needs a Doomsday Device

Let me make this clear, it is best not to keep personal stuff on a work computer. But sometimes it is unavoidable and there might be a time when you need to get rid of it all, fast.

If so, you need my Doomsday Device, a batch file that will quickly delete all personal information from your computer.

WARNING: The Doomsday Device is irreversible. Deleted files and directories cannot be retrieved.

Okay, files and directories can be retrieved, but not in the conventional way, unless you have backups, which will also need to be deleted.

Here's the Doomsday Device code. Copy and paste it into a text file, change the paths, as necessary, and save it in an easily accessible location as Doomsday.bat. See below the code for an explanation of how it works.
@echo off
COLOR 0A
echo DOOMSDAY DEVICE!
echo.
echo.DELETE ALL PERSONAL DATA FROM THIS COMPUTER.
echo.
echo.
@echo off
:getConfirmation
set /p confirmDeploy=Are you sure you want to deploy the Doomsday Device? [Y/N]:
if /i "%confirmDeploy%"=="Y" goto:rundoomsday
if /i "%confirmDeploy%"=="N" goto:canceldoomsday
:canceldoomsday
echo.
ECHO WHEW! DOOMSDAY DEVICE CANCELLED.
echo.
GOTO:end

:rundoomsday
echo.
ECHO DEPLOYING DOOMSDAY DEVICE...
echo.
echo.
ECHO **** First uninstall Dropbox and Google Drive from Control Panel...
appwiz.cpl 
echo.
echo.
Pause

echo.
del /s /q "C:\Users\Yossi.Karp\Documents\Outlook Files\General.pst"  
RMDIR /s /q "C:\Users\Yossi.Karp\Dropbox"
RMDIR /s /q "C:\Users\Yossi.Karp\Google Drive"
RMDIR /s /q "C:\Users\Yossi.Karp\Downloads"
RMDIR /s /q "C:\Users\Yossi.Karp\Personal"

REM The following clears Chrome history/cache
ECHO **** Clearing Chrome cache
taskkill /F /IM "chrome.exe">nul 2>&1
ping -n 10 127.0.0.1

@echo off
set ChromeDir=C:\Users\%USERNAME%\AppData\Local\Google\Chrome\User Data\
ping -n 5 127.0.0.1
set ChromeDir=C:\Users\Yossi.Karp\AppData\Local\Google\Chrome\User Data\

del /q /s /f "%ChromeDir%"  rd /s /q "%ChromeDir%"

ECHO **** Clearing Chrome cache DONE
echo.
ECHO DOOMSDAY DEVICE HAS DELETED ALL PERSONAL DATA.
echo.
GOTO:end

:end
echo.
ECHO DOOMSDAY DEVICE HAS POWERED DOWN.
echo.
pause
Here's a break-down of how the code works.

This section sets the font color to an appropriately ominous green. The title "DOOMSDAY DEVICE!" displays and a line of text appears explaining what the Doomsday Device does.
@echo off
COLOR 0A
echo DOOMSDAY DEVICE!
echo.
echo.DELETE ALL PERSONAL DATA FROM THIS COMPUTER.
echo.
echo.
@echo off
@echo off
This next bit asks you to confirm that you actually want to continue running the Doomsday Device (it would be a big "oops" if this wasn't part of the code and you accidentally ran the Doomsday Device and deleted all your stuff).
:getConfirmation
set /p confirmDeploy=Are you sure you want to deploy the Doomsday Device? [Y/N]:
if /i "%confirmDeploy%"=="Y" goto:rundoomsday
if /i "%confirmDeploy%"=="N" goto:canceldoomsday
The following code cancels the Doomsday Device if you type n, and displays text to confirm that the Doomsday Device has been deactivated.
:canceldoomsday
echo.
ECHO WHEW! DOOMSDAY DEVICE CANCELLED.
echo.
GOTO:end
If you typed y to continue, text indicating that the Doomsday Device has deployed appears on the screen. Instructions to uninstall programs via Control Panel display. In my case, this is Dropbox and Google Drive. The appwiz.cpl command opens Control Panel for you, making it more convenient (and quicker) to uninstall those programs. The pause command waits for your input before continuing.
:rundoomsday
echo.
ECHO DEPLOYING DOOMSDAY DEVICE...
echo.
echo.
ECHO **** First uninstall Dropbox and Google Drive from Control Panel...
appwiz.cpl 
echo.
echo.
Pause
From this point on, everything is automatic - there is no turning back!
The del command deletes an Outlook PST file I called "General".
The RMDIR commands delete a bunch of directories on my C drive.
You will need to change the files and directories to suit your situation. Copy the format in the code below to add as many files and directories to this list as you like (one line per item).
echo.
del /s /q "C:\Users\Yossi.Karp\Documents\Outlook Files\General.pst"  
RMDIR /s /q "C:\Users\Yossi.Karp\Dropbox"
RMDIR /s /q "C:\Users\Yossi.Karp\Google Drive"
RMDIR /s /q "C:\Users\Yossi.Karp\Downloads"
RMDIR /s /q "C:\Users\Yossi.Karp\Personal"
The program progresses automatically to the next set of code, which deletes the Chrome history and cache (there is even a comment in the code telling you this). taskkill shuts down Chrome. The ping command is just there to cause a delay to give the Windows Task Manager time to shut down Chrome completely.
REM The following clears Chrome history/cache
ECHO **** Clearing Chrome cache
taskkill /F /IM "chrome.exe">nul 2>&1
ping -n 10 127.0.0.1
Next, the Doomsday Device goes to the Chrome directory and deletes the Chrome history and cache. Text displays confirming that the command was carried out.
@echo off
set ChromeDir=C:\Users\%USERNAME%\AppData\Local\Google\Chrome\User Data\
ping -n 5 127.0.0.1
set ChromeDir=C:\Users\Yossi.Karp\AppData\Local\Google\Chrome\User Data\
del /q /s /f "%ChromeDir%"  rd /s /q "%ChromeDir%"
ECHO **** Clearing Chrome cache DONE
The next bit of code displays text that the Doomsday Device has done its job. The pause command waits for your input before closing the Doomsday Device window.
echo.
ECHO DOOMSDAY DEVICE HAS DELETED ALL PERSONAL DATA.
echo.
GOTO:end
:end
echo.
ECHO DOOMSDAY DEVICE HAS POWERED DOWN.
echo.
pause
I hope that you only have to use the Doomsday Device under your own terms - but either way, you are now prepared.

Thanks to DK for his help ironing out some of the bugs in my initial code.

Follow on Twitter: @ykarp
Follow on Google+: +Yossi Karp
Subscribe to Y. Karp? Why Not! or follow on Facebook (see the side-bar).
Add this blog to your RSS feed reader.

Comments

Popular posts from this blog

Playing With My Mind

Act Your Age, Not Your Shoe Size

Lessons from a Couch