I'm building a demo involving 2 SQL Servers and a shared backup directory.
In the process of building the following batch file (which removes a directory/share (if it already exists), then creates a directory/structure and shares it), I was running the commands by hand in the command prompt:
@Echo off
REM Delete share/directory if already in existance
net share Backup /DELETE
rd /S /Q C:\Backup
REM Create directory/share
md C:\Backup
md C:\Backup\Logs
net share Backup=C:\Backup
EcHO ---- Press any key to continue ----
pause >nul
Only, when I went to type rd /S /Q C:\Backup, I accidentally typed rd /S /Q C: and instead of hitting \ I hit ENTER. The good news: That's a bloody fast way delete every file on a drive (that isn't locked/in-use by a process). The bad news, that's a Bloody fast way to delete every file on your drive (that isn't currently in use).
Needless to say, I'm waaay glad that I was doing this on a VM (in VMWare 5).
Of course, you could think of this as the poor-man's dejunker: Just open the programs you want to keep (and any files you want to keep on your C: drive) and then delete everything ;)
Haha! That's awesome, I damn near wet myself. I've been in that position MANY times -- especially with the \ character living where it does on most keyboards. As you said, good thing it was on a VM. :)
Posted by: Brian | August 03, 2005 at 01:18 PM
IIRC, the rd request autorization if you pass the /s flag. But it is indeed a /very/ nasty thing, I switched keyboard 6 months ago and I /stiil/ not used to the new layout. BTW, about the dejunker - there are files that are not used which are needed to boot the system.
Posted by: Ayende Rahien | August 03, 2005 at 10:07 PM
BTW, about the dejunker - there are files that are not used which are needed to boot the system. Yeah, I found that out when I tried to reboot the Virtual Machine. (It confirmed what I suspected... which was that rd c: is reaally realllly bad).
Posted by: Michael K. Campbell | August 03, 2005 at 11:22 PM