Run batch files as administrator user

batch-filewindows 7windows-pe

I have a segment with 100 computers.

I am booting each machne from WinPE OS located on a CD. After the OS has finished loading, I want to automatically run a batch file that will copy the CD to the C:\ drive.

My questions:

  1. How can I edit the WinPe ISO to run the batch file automatically after booting?
  2. Copy to C:\ drive required an admin privilages, how can I write it to run as admin? (I can't use "Run As" command since I dont know what the name and the password of admin on each computer are).

Best Answer

I don't know how you've created the WinPE ISO, I presume it's with the WAIK?

When you're building the image, create a new text file in notepad called Winpeshl.ini and store it in the build_directory\mount\Windows\System32. In that file, call the batch file.

To make it a bit easier and quicker, see if this link will help. I used it to see when I was trying to auto-launch RDP from a WinPE enviroment as asked in this question