windows server 2008 R2 unattened install from DVD

Medquest
Medquest used Ask the Experts™
on
hi all,

I have an answer file for installing windows server 2008 from DVD and so far it seems to be working fine except one part that I couldn't get to work.

I am trying to run a batch file at first logon and the batch file is located in DVDRoot\Scripts\PostSetup.bat. how do I get this batch file to run at first logon?

all comments are greatly appreciated.


Thanks
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®

Author

Commented:
sorry I forgot to attach the file I am using.
EE-Answer-File-Sample..txt
Distinguished Expert 2017

Commented:
The entry to run the file needs to be added to the runonce registry key.
Unfortunately, I do not know what you need to specify in the answer file to do that.

You seem to have that, but instead of .\Scripts\postsetup.bat, you should use a full path D:\scripts\PostSetup.bat or copy the file to a local location from which it will be run.

Author

Commented:
I will not know the actual path, because the CD rom letter may change and also when am installing from an ISO file with hyper-v there's not CD rom.
 
this batch file will install lots of things such as drivers and applications, but right now I only have one line in it to create a folder on the root of the C drive just to see if it works.
 
Thanks
 
11/26 Forrester Webinar: Savings for Enterprise

How can your organization benefit from savings just by replacing your legacy backup solutions with Acronis' #CyberProtection? Join Forrester's Joe Branca and Ryan Davis from Acronis live as they explain how you can too.

Commented:
you add the command here (attached picture)
waik.jpg
Distinguished Expert 2017

Commented:
From the suggestions you've gotten what have you tried and what was the effect?
An option is to copy the file from the DVD to a known location on the HD and then add the registry entry to the hklm runonce which will be trigger once on first logon.

Author

Commented:
non of the suggestions I got worked, and no effect at all, because the command will not run. I can't copy anything on the hard drive, because I have to format it before loading the OS.
 
Thanks
 
Distinguished Expert 2017

Commented:
The same way you install the OS after the drives are formatted, you might be able to copy the file from the DVDroot to the hard drive.  You have a reference to .\scripts\file you need to change it to point to a location where the file is on the drive i.e. c:\runonce\script\filename in your answer file. the entry you have is under the LogonCommands section versus on the firstlogoncommand.

The problem you might be having is that the bat file is not being copied or is not being properly referenced such that on firstlogon it can not be accessed.  Does the system error out saying can not load .\scripts\filename.bat?

The other option is to look at what options are available under the autologon option jacob_di has in the snapshot.

Author

Commented:
the problem is that the drive could be any drive letter and the other problem is that some times the setup runs from an ISO file. all the options I found inthe screenshot point to drive letter that's not helping me.
 
any other ideas?
 
Thanks
 
Distinguished Expert 2017

Commented:
Is there an option within the setup/answer file that would direct the copying of the file to a particular location on the hard drive?
you can use the %HOMEDRIVE%\scripts\file.bat where %HOMEDRIVE% is set by the system for the OS drive.
What have you tried and how far has it gotten you?
There are ways to identify where the CD/DVD disk is.
There is a way to use wmic or other tools to list the installed drives of a specific type.

After you install, do you get an error dealing with trying to run that script?

Did you change the answer file from running the script at logon (logoncommand) to first logon (firstlogoncommand)?

In order to get additional suggestions, you need to provide some feedback which," no, it does not work" is not.

What is not helping you with drive letters.  The OS will be on C drive.
With a single partition the DVD rom will be drive letter D:
With a two partition OS, the dvd rom will be E.

Are you able to see an option where the file during the install can be copied from the DVD media to the local formated/partitioned drive?

Author

Commented:
I am working with Microsoft setup team and as soon as I get the solution, I'll post it here, because I really don't have time during the day to test things here and there until I get something to work.
 
thanks for trying to help.
Distinguished Expert 2017

Commented:
Make sure to take notes and instead of deleting this question, you could provide the step-by-step for others who would find it useful.

Author

Commented:
will do.
Commented:
ok guys I am back with Microsoft wisdom :), I was working with a very smart indian guy really and he did a good jon helping me with this.
 
the answer file that worked real well me is attached this post. after booting from the DVD, the only option that  I have to decide for myself is which edition of windows server 2008 R2 I want to install and then after that it all goes automatic.
as soon as setup completes, the system auto logon as administrator and it runs first batch file W2K8R2-FINALIZE.bat, and part of this script is to copy another batch file to run as next login, and then the second one finishes whatever left.
 
good luck to you all, and now I think this quesiton is ready to be as resolved by owner.
 
thanks
 

autounattend----EE-.xml
W2K8R2-FINALIZE.txt
W2K8R2-FINALIZE-LOCAL.txt

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial