MSFN Forum: LaunchApps in Winpeshl.ini not running - MSFN Forum

Page 1 of 1

LaunchApps in Winpeshl.ini not running Rate Topic: //<![CDATA[ rating = new ipb.rating( 'topic_rate_', { url: 'http://www.msfn.org/board/index.php?app=forums&module=ajax&section=topics&do=rateTopic&t=119465&md5check=' + ipb.vars['secure_hash'], cur_rating: 0, rated: 0, allow_rate: 0, multi_rate: 1, show_rate_text: true } ); //]]>

#1niveknonrev

• Group: Members
• Posts: 5
• Joined: 21-December 04

Posted 20 June 2008 - 08:12 AM

I have searched but I can't seem to find the problem.
I have a custom WinPE 2.x and it boots great, everything works just like it is supposed to except the [LaunchApps] section of my Winpeshl.ini.

All I'm asking it to do is fire off the startnet.cmd file after my bsexploreshell is loaded.

-------------------------
[LaunchApp]
AppPath = %SYSTEMDRIVE%\bsexploreshell\explorer.exe

[LaunchApps]
cmd /c %systemroot%\System32\Startnet.cmd
-------------------------

That way I can have the nice GUI shell, and also autorun the wpeinit.exe and any other scripts I add to startnet.

I know that the winpeshl.ini is working part way because my bsexplore shell is working great!
Then I can manually run startnet.cmd and it works fine, but why doesn't it run automagically?

Any help is appreciated.
Maybe its something I just missed.

Thanks

#2bj-kaiser

• Group: Members
• Posts: 415
• Joined: 05-December 06
• OS:Windows 7 x86
• Country:

Posted 21 June 2008 - 02:59 PM

In launchapps, the commandline options are separated by a ", " from the executable/command.

http://technet2.microsoft.com/WindowsVista...88eb651033.mspx

#3Tripredacus

• K-Mart-ian Legend
• Group: Super Moderator
• Posts: 8,669
• Joined: 28-April 06
• OS:Server 2012
• Country:

Posted 23 June 2008 - 09:59 AM

I had this problem also, but I switched over to using the startnet.cmd only.

#4niveknonrev

• Group: Members
• Posts: 5
• Joined: 21-December 04

Posted 23 June 2008 - 11:50 AM

I tried the following combinations, but none worked.

Just to see if anything would work
[LaunchApps]
cmd.exe

[LaunchApps]
%systemroot%\System32\Startnet.cmd

if forgot the "comma" in the first post, but I did try it like this
[LaunchApps]
cmd.exe, /c %systemroot%\System32\Startnet.cmd

That is the article I used whe I created it, but it doesn't work like the help file or article says.

Any other ideas?
Thanks
Kevin

#5bj-kaiser

• Group: Members
• Posts: 415
• Joined: 05-December 06
• OS:Windows 7 x86
• Country:

Posted 23 June 2008 - 12:08 PM

niveknonrev, on Jun 23 2008, 07:50 PM, said:

I tried the following combinations, but none worked.

Just to see if anything would work
[LaunchApps]
cmd.exe

[LaunchApps]
%systemroot%\System32\Startnet.cmd

if forgot the "comma" in the first post, but I did try it like this
[LaunchApps]
cmd.exe, /c %systemroot%\System32\Startnet.cmd

That is the article I used whe I created it, but it doesn't work like the help file or article says.

Any other ideas?

without looking at my winpeshl.ini, maybe this is worth a try?


[LaunchApps]
cmd.exe, "/c %systemroot%\System32\Startnet.cmd"


#6niveknonrev

• Group: Members
• Posts: 5
• Joined: 21-December 04

Posted 23 June 2008 - 01:06 PM

Bummer none of those options worked.
Don't know why - no errors or anything.
Nothing I put in LaunchApps section gets run, with or without options, or quotes, or spaces, or anything.

Well im stuck with the startnet.cmd window as my shell for now,
I just put a big "echo" banner in it saying DONT CLOSE IT
LOL...

If anyone else has run into this and figured out a way to get it to work let me know.
I am using the following:
WAIK 1.1
VMWare Workstation 6.x to test in
Running on a Vista (no sp1) host

Thanks!

#7bj-kaiser

• Group: Members
• Posts: 415
• Joined: 05-December 06
• OS:Windows 7 x86
• Country:

Posted 23 June 2008 - 01:37 PM

hm, just try enclosing the whole commandline in quotes. It dawns to me that the documentation wasnt really close to reality.

#8Tripredacus

• K-Mart-ian Legend
• Group: Super Moderator
• Posts: 8,669
• Joined: 28-April 06
• OS:Server 2012
• Country:

Posted 23 June 2008 - 01:44 PM

Wait, I am confused here. Are you saying that your startnet.cmd doesn't automatically launch when you boot the PE? If so it sounds like you skipped a step! The default PE setup doesn't even use the winpeshl.ini and the startnet.cmd opens by itself.

#9niveknonrev

• Group: Members
• Posts: 5
• Joined: 21-December 04

Posted 24 June 2008 - 06:41 AM

Tripredacus, on Jun 23 2008, 02:44 PM, said:

Wait, I am confused here. Are you saying that your startnet.cmd doesn't automatically launch when you boot the PE? If so it sounds like you skipped a step! The default PE setup doesn't even use the winpeshl.ini and the startnet.cmd opens by itself.

Tripedacus, thanks for looking at this post.

No that is not what I am saying. Startnet.cmd launches perfectly all by itself. However following Microsoft's instructions for launching a "custom shell" or "custom apps" etc. It says to use the winpeshl.ini file, the LaunchApp with the AppPath = %systemdrive%\myshell.exe - etc.

Then you are supposed to be able to uset the LaunchApps section to launch other applications after your shell starts.
I followed the directions below using BSExplore as my shell, but it still didn't work:

Winpeshl.ini FilesWinpeshl.ini controls whether a customized shell is loaded in Windows PE instead of the default Command Prompt window. To load a customized shell, create a file named Winpeshl.ini and place it in %SYSTEMROOT%\System32 of your customized Windows PE image. The .ini file must have the following section and entry.

[LaunchApp]
AppPath = %SYSTEMDRIVE%\myshell.exe
[LaunchApps]
%SYSTEMDRIVE%\mydir\application1.exe, -option1 -option2
application2.exe, -option1 -option2

Set the AppPath entry to the path to your shell application. The path can be either fully qualified, or you can use environment variables, such as %SYSTEMROOT%\System32\Myshell.exe. The AppPath entry does not support command-line options.

Use the [LaunchApps] section to run applications with command-line options. The applications run in the order listed; separate the name of the application from its options with a comma.

When you exit the Command Prompt window or your customized shell application, Windows PE restarts.

This way I wouldn't have the "command prompt" as my shell. I know it is just a cosmetic change (the shell), but I just thought it sounded like a better way to do it.

Thanks!

#10Tripredacus

• K-Mart-ian Legend
• Group: Super Moderator
• Posts: 8,669
• Joined: 28-April 06
• OS:Server 2012
• Country:

Posted 24 June 2008 - 12:19 PM

Yes, It does indeed seem like a better way, but I like having the command prompt there. If you put your custom app in the startnet.cmd, it will open on top of the command prompt. So if your app is full-screen you won't see the CMD anyways. But you can still get to it if you alt+tab there.

#11paxamime

• Newbie
• Group: Members
• Posts: 36
• Joined: 28-September 06

Posted 26 June 2008 - 02:39 PM

If your looking for a cleaner way of launching multiple programs I suggest doing it a different way. Create an xml file with your applications you want to run, save it in system32 and edit your Startnet.cmd

In Startnet.cmd: wpeinit.exe /Unattend=X:\Windows\System32\wpeinit.xml


<?xml version="1.0" encoding="utf-8"?>
<unattend xmlns="urn:schemas-microsoft-com:unattend">
<settings pass="windowsPE">
<component name="Microsoft-Windows-Setup" processorArchitecture="x86" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<EnableNetwork>true</EnableNetwork>
<EnableFirewall>true</EnableFirewall>
</component>
<RunSynchronous>
<!-- First synchronous command to execute -->
<RunSynchronousCommand>
<Order>1</Order>
<Path>\\MyNetworkShare\MyApplication.exe</Path>
<Description>DescriptionOfMyApplication</Description>
<Credentials>
<Domain>FabrikamDomain</Domain>
</Credentials>
</RunSynchronousCommand>
<!-- Second synchronous command to execute -->
<RunSynchronousCommand>
<Order>2</Order>
<Path>C:\AnotherApplication.exe</Path>
<Description>DescriptionOfMyApplication</Description>
</RunSynchronousCommand>
</RunSynchronous>
</settings>
</unattend>


For the documentation on this go to your Windows AIK Documentation directory: C:\Program Files\Windows AIK\Docs\CHMs\Unattended.chm

#12yaleyu

• Group: Members
• Posts: 5
• Joined: 26-July 08

Posted 30 July 2008 - 08:31 PM

I cannot get LaunchApps work in winpeshl.ini, except the AppPath=... shell line, all other lines are unable to run, doesn't matter it's startnet.cmd, x:\windows\system32\startnet.cmd, or %systemdrive%\startnet.cmd

#13phgddr

• Group: Members
• Posts: 2
• Joined: 22-August 08

Posted 22 August 2008 - 02:16 AM

Hello,

I found a solution which allows to launch many applications from winpeshl.ini. From what I have observed, it seems you cannot use both [LaunchApp] and [LaunchApps] sections together. So if you have many applications to launch just use [LaunchApps] and put your shell in the last position. Here is my winpeshl.ini file which works fine :

[LaunchApps]
%SYSTEMDRIVE%\Windows\system32\startnet.cmd
%SYSTEMDRIVE%\Programs\bginfo.exe, "%SYSTEMDRIVE%\Programs\bginfo.bgi /timer:0 /accepteula"

Be careful, the syntax of the commands is a bit tricky in case there are arguments. There MUST be a comma after the command itself and, in case there multiple arguments, all the arguments MUST be enclosed between double quotes (see bginfo line in the previous example).

This post has been edited by phgddr: 22 August 2008 - 02:19 AM

#14phgddr

• Group: Members
• Posts: 2
• Joined: 22-August 08

Posted 22 August 2008 - 02:18 AM

phgddr, on Aug 22 2008, 10:16 AM, said:

Hello,

I found a solution which allows to launch many applications from winpeshl.ini. From what I have observed, it seems you cannot use both [LaunchApp] and [LaunchApps] sections together. So if you have many applications to launch just use [LaunchApps] and put your shell in the last position. Here is my winpeshl.ini file which works fine :

[LaunchApps]
%SYSTEMDRIVE%\Windows\system32\startnet.cmd
%SYSTEMDRIVE%\Programs\bginfo.exe, "%SYSTEMDRIVE%\Programs\bginfo.bgi /timer:0 /accepteula"

Be careful, the syntax of the commands is a bit tricky in case there are arguments. There MUST be a comma after the command itself and, in case there multiple arguments, all the arguments MUST be enclosed between double quotes (see bginfo line in the previous example).

This post has been edited by phgddr: 22 August 2008 - 02:20 AM

#15Schiiwa

• Junior
• Group: Members
• Posts: 74
• Joined: 23-December 10
• OS:none specified
• Country:

Posted 19 October 2011 - 03:14 PM

phgddr, on 22 August 2008 - 02:18 AM, said:

phgddr, on Aug 22 2008, 10:16 AM, said:

Hello,

I found a solution which allows to launch many applications from winpeshl.ini. From what I have observed, it seems you cannot use both [LaunchApp] and [LaunchApps] sections together. So if you have many applications to launch just use [LaunchApps] and put your shell in the last position. Here is my winpeshl.ini file which works fine :

[LaunchApps]
%SYSTEMDRIVE%\Windows\system32\startnet.cmd
%SYSTEMDRIVE%\Programs\bginfo.exe, "%SYSTEMDRIVE%\Programs\bginfo.bgi /timer:0 /accepteula"

Be careful, the syntax of the commands is a bit tricky in case there are arguments. There MUST be a comma after the command itself and, in case there multiple arguments, all the arguments MUST be enclosed between double quotes (see bginfo line in the previous example).

Why not include the 2nd and 3rd in STARTNET.CMD to avoid the unlovely comma & quotes?

This post has been edited by Schiiwa: 19 October 2011 - 03:18 PM

#16Tripredacus

• K-Mart-ian Legend
• Group: Super Moderator
• Posts: 8,669
• Joined: 28-April 06
• OS:Server 2012
• Country:

Posted 20 October 2011 - 07:47 AM

The big difference between the two options is that if you use winpeshl.ini, you don't get the command prompt. This is a much better option if you don't want the end-user to have access to the prompt, say if you were making a recovery partition.

#17Schiiwa

• Junior
• Group: Members
• Posts: 74
• Joined: 23-December 10
• OS:none specified
• Country:

Posted 20 October 2011 - 09:50 AM

Tripredacus, on 20 October 2011 - 07:47 AM, said:

The big difference between the two options is that if you use winpeshl.ini, you don't get the command prompt. This is a much better option if you don't want the end-user to have access to the prompt, say if you were making a recovery partition.

U didn't understand what i try to say. I related to the previous post #14

That was in my mind:

Make a Winpeshl.ini:

[LaunchApps]
%SYSTEMDRIVE%\Windows\system32\startnet.cmd


And a startnet.cmd

REM wpeinit
%SYSTEMDRIVE%\Programs\bginfo.exe %SYSTEMDRIVE%\Programs\bginfo.bgi /timer:0 /accepteula
X:\sources\recovery\recenv.exe


BUT:

As expected the cmd-windows stays behind the shell until reboot, or if it will be closed, reboot is the consequence
I will try to run my Commands from [LaunchApps] now to avoid the CMD in background

rundll32 setupapi,InstallHinfSection DefaultInstall 132 %SystemDrive%\windows\system32\drivers\wimfltr.inf
Net start wimfltr



According to phgddr's post #13, it should look like this:
%SYSTEMDRIVE%\Windows\System32\rundll32.exe, "setupapi,InstallHinfSection DefaultInstall 132 %SYSTEMDRIVE%\windows\system32\drivers\wimfltr.inf"
%SYSTEMDRIVE%\Windows\System32\net.exe, "start wimfltr"
%SYSTEMDRIVE%\sources\recovery\recenv.exe



works great..... big thanks to phgddr

This post has been edited by Schiiwa: 20 October 2011 - 05:02 PM