Skip navigation

How can I automate Emergency Repair Disk (ERD) creation?

A. The old RDISK /-s silent switch no longer works because ntbackup.exe is now used to create the ERD. However, using Windows Script Host (WSH), you can emulate this option by including the following text in file rdisk.js. After you add the text, simply double-click rdisk.js, insert a diskette, and the script will create the ERD.

var shell = new ActiveXObject("WScript.Shell");<br>
shell.Popup("Please insert blank floppy disk in the drive A:", 15);<br><br>

shell.Run("ntbackup.exe");<br>
WScript.Sleep("500");<br><br>

shell.Sendkeys("%m"); //selects the Emergency repair, % is Alt<br><br>

shell.Sendkeys("~"); //presses Enter (could have used \{ENTER\} instead of ~)<br><br>

WScript.Sleep("15000"); //pauses for 15 seconds so as to not Enter the Cancel!!! You may need to change this.<br><br>

shell.Sendkeys("%\{F4\}"); //tries to close but fails and selects the OK button. <br><br>

shell.Sendkeys("~"); //presses Enter (could have used \{ENTER\} instead of ~) after it has completed<br><br>

shell.Sendkeys("%\{F4\}"); //closes NTBACKUP<br><br>

WScript.Quit();<br>
Hide comments

Comments

  • Allowed HTML tags: <em> <strong> <blockquote> <br> <p>

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
Publish