Jump to content
Strawberry Orange Banana Lime Leaf Slate Sky Blueberry Grape Watermelon Chocolate Marble
Strawberry Orange Banana Lime Leaf Slate Sky Blueberry Grape Watermelon Chocolate Marble

MSFN is made available via donations, subscriptions and advertising revenue. The use of ad-blocking software hurts the site. Please disable ad-blocking software or set an exception for MSFN. Alternatively, register and become a site sponsor/subscriber and ads will be disabled automatically. 


vishyc88

Automatically execute bat script after winpe is loaded

Recommended Posts

Hi friends,

Is it possible to automatically run a bat script after the winpe environment has been created? Im trying to do this to automatically kickoff of the windows 7 installation from windows pe environment.

Following are the commands i wish to execute:

> net use z: \\172.16.255.254\win7 jet-123 /user:student

>z:\setup.exe

Please Please help!

Thanks

Share this post


Link to post
Share on other sites

Sure. There is a bat file already that starts WinPE, it is startnet.cmd. Make sure your winpeshl.ini is blank or it will ignore the startnet.cmd. Here is one of my old startnet.cmd files:

wpeinit
wpeutil initializenetwork
ping 127.0.0.1 -n 16 -w 1000>null
net use z: \\7SERVER\images ZarleyZalapski33 /user:kdineen
regsvr32 /s misc/gimagex_com.dll
mshta.exe x:\windows\system32\imagex.hta

So you probably just need wpeinit as the first option, then your other two commands right afterwards. This file is located in x:\windows\system32

Share this post


Link to post
Share on other sites

Hi, I am not able to find the winpeshl.ini file in the image. where is it located?

Please let me know

Thanks

Share this post


Link to post
Share on other sites

Hi, I am not able to find the winpeshl.ini file in the image. where is it located?

Please let me know

Thanks

I should be in the *Winperoot*\windows\system32\winpeshl.ini

Share this post


Link to post
Share on other sites

Hi ...im back!

Im able to start the installation, everything's fine but the time taken to load wpeinit is too much. It takes atleast 5 - 10 mins just to load wpeinit. Otherwise everything's working like charm. I dont understand.

Im using winpe 2.0. Will upgrading to winPE 3.0 improve the speed?

Please lemme know

Share this post


Link to post
Share on other sites

Im using winpe 2.0. Will upgrading to winPE 3.0 improve the speed?

Please lemme know

Share this post


Link to post
Share on other sites

How about running a custom batchfile during WinPE?  Or Specialize?  Audit  Can I just use the <commandprompt> and run it throught there?  John

Share this post


Link to post
Share on other sites
6 hours ago, RBCC said:

How about running a custom batchfile during WinPE?  Or Specialize?  Audit  Can I just use the <commandprompt> and run it throught there?  John

Not sure to understand. :unsure:

 

The auto-execution in WinPE is a bit tricky, but nothing too complex, see:

 https://msfn.org/board/topic/119465-launchapps-in-winpeshlini-not-running/

 

Of course you can run a batch from the command prompt, but you will be running it manually if you dont use any of the provisions above.

jaclaz

 

Share this post


Link to post
Share on other sites

Because RBCC also put "specialize" into his post, I am thinking he is not meaning WindowsPE, rather the WinPE phase of Windows Setup.

Share this post


Link to post
Share on other sites
1 hour ago, Tripredacus said:

Because RBCC also put "specialize" into his post, I am thinking he is not meaning WindowsPE, rather the WinPE phase of Windows Setup.

Well he put "or specialize".

Anyway, he seems to have posted basically the same question over a few related or unrelated topics without ever managing to explain clearly what he actually needs/wants.

 

jaclaz

Share this post


Link to post
Share on other sites

I Have a folder of applications in the Windows section of my hard drive with a batch file that will run all the application setups silently.   Ok with that said I would like to run in the WinPE or specialize section of the WIndows setup  that batch file, which is apps.bat.  Do I use  the runasychronous  or the runsyncronous command?  Also do I put /cmd <path to batch\apps.bat >  in this part of the windows 10 answerfile?  Can you run application installs during this phase?   

 

Also when you make the disk partition info in the answer file does it actually make the partitions or do I have to use diskpart?  John

PS I am using this question from now on ignore the rest!  John

Share this post


Link to post
Share on other sites

You wouldn't be able to execute the command in the windowsPE phase because the hard drive will be blank. If your applications are in your image, then you would need to run it during specialize or oobeSystem phase.

If you are only running one command, it doesn't matter if you run synchronous or asynchronous. The difference between the two is the equivalent to running something from cmd using /wait command.

For partitions, if you are using setup.exe, then you use the answer file to set up partitions. If you are using DISM to appy the image, you use diskpart.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


  • Recently Browsing   0 members

    No registered users viewing this page.

×