locked
script to format hard drive RRS feed

  • Question

  • I am not sure if this is the right place to ask this, so I apologise if it is not. But i was wondering if someone could help me with a little bit of code.

    I am about to travel to the middle east for work. And its not the safest of places these days. I have been looking around to try and find some basic coding that will delete my hard drive when pressed. Something basic like a notepad file saved as a .exe/.bat that I can just run in case of a emergency.

    Having looked around I have found this: format c:\ /Q/X
    Which i belive will do the trick, but I also use a external hard drive, and Pen drives. How could i impliment the code to delete these as well. And to also run after reboot onces used. (incase i try to run it and the laptop is turned off, or power is cut)

    Thank you

    (its going to be ruin on a windows 7 laptop)         
    Wednesday, May 9, 2012 3:03 PM

Answers

  • Hi,

    You can't format an active drive. However, you can implement BitLocker encryption such that even if your drive was stolen, the data would be encrypted and therefore useless.

    Bill

    • Proposed as answer by Richard MuellerMVP Thursday, May 10, 2012 10:46 PM
    • Marked as answer by IamMred Monday, May 14, 2012 8:25 PM
    Wednesday, May 9, 2012 3:06 PM

All replies

  • Hi,

    You can't format an active drive. However, you can implement BitLocker encryption such that even if your drive was stolen, the data would be encrypted and therefore useless.

    Bill

    • Proposed as answer by Richard MuellerMVP Thursday, May 10, 2012 10:46 PM
    • Marked as answer by IamMred Monday, May 14, 2012 8:25 PM
    Wednesday, May 9, 2012 3:06 PM
  • I don't know if that was a Freudian slip: "(its going to be ruin on a windows 7 laptop)". 

    What version of Windows 7 are you using.  If it's Ultimate or Enterprise, you have access to Bitlocker.  This is the preferred way of protecting your data.

    You can't format your C: drive from within Windows.  The system won't let you.  You will have to think this through again.


    Grant Ward, a.k.a. Bigteddy

    What's new in Powershell 3.0 (Technet Wiki)

    Wednesday, May 9, 2012 3:10 PM
  • Hi,

    You can't format an active drive. However, you can implement BitLocker encryption such that even if your drive was stolen, the data would be encrypted and therefore useless.

    Bill

    I would qualify this. Only Windows Enterprise and Ultimate have Bitlocker

    Grant Ward, a.k.a. Bigteddy

    What's new in Powershell 3.0 (Technet Wiki)

    Friday, May 11, 2012 5:36 AM
  • Good point Grant.

    Bill

    Friday, May 11, 2012 4:11 PM
  • Here's an idea:

    • Create a second partition and load it with another OS (WinPE, DOS or *nix).
    • Load a disk wipe or secure format utility to automatically run when this second partition is booted.
    • Create a script to run in case of emergency and place it on your desktop or assign a hotkey to launch the script
    • The script should update your boot.ini to boot to that second partition. (KB289022) Or use an alternate boot loader. (GRUB?)
    • The script should force a reboot (or even better, crash & reboot). May need to setup something like this ahead of time: Forcing a System Crash from the Keyboard or Forcing a System Crash from the Debugger

    Just backup first before testing.

    Friday, May 11, 2012 5:19 PM
  • The easiest way to erace a drive is to insert teh instll DVD/CD and boot to the admin consloe.  You can then choose to format the drive.

    An easy method is to select new install and then select to reformat the drive.


    ¯\_(ツ)_/¯

    Friday, May 11, 2012 5:37 PM