Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to automate the Windows 7 Recovery Environment. I want the computer to be able to boot into the Recovery Environment, automatically run some commands, and then restart back into Windows.

The reason for this is that I want to use the Recovery Environment to edit some system files that are not writable while Windows is running. (Of course, this could be done using GRUB and Linux, but it would be even better if one could use the built-in Windows Recovery Environment and avoid the need to install a separate bootloader and OS.)

So far, I've found out how to tell Windows 7 to reboot into the recovery environment:

reagentc /boottore
shutdown /r /t 0

But once the Recovery Environment loads, it opens a dialog that requires user input to continue. Instead of that dialog, I would like to be able to specify a script to run instead.

Any ideas on how to accomplish this would be appreciated. Thanks!

share|improve this question

I know that this is an old question, but found the answer while looking into this problem myself. Just go into Recovery folder in C drive.If it says access denied, you will have to take ownership. To take ownership rt click go to properties- security tab. Click on advanced and go to Owner tab and take ownership. After this, extract the winre.wim into a folder using Dism tool in command prompt. Now go into system32 folder in the extracted winre and edit winpeshl.ini. Remove the launch entry that is already there. This will remove the UI which prompts us to enter password. Now put your script location there instead. Now using Dism tool, unmount the extracted folder back into winre.wim. Now all you have to do is go into recovery mode and your script will run without the winre startup UI coming.-

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .