Run batch command after fba

  • Thread starter Thread starter steve
  • Start date Start date
S

steve

I'm having a problem executing a batch file to change some registry settings
like hostname, ip configuration stuff.
The .bat file works fine when ran from a command line after the target
system has been built, but it fails when I built it as a component into the
image of target machine.

I tried adding a RunOnce Resource to the component and setting the
appropriate properties to execute the batch file. I also set the build
order to 8510. When I did this, in the middle of "Installing PNP Devices"
it gave me a Windows Script Host error
"Can't find script engine "VBScript" for script ... ".
So I realize that Windows Script Host has not been installed yet. And then
a few minutes later I notice a box saying "Processing RunOnce Items" which
is where I'd like to have my component execute, or even after that. Simply,
I want to execute a command after the whole image has been built. You help
is much appreciated.

Steve
 
KM

I will try using FBA Generic Command and find out how it works.
I'm using a custom shell so I'm not sure if StartUp items is an option,
since there are no users.
Thnaks.

Steve
 
Same error occurred at right about the same spot ("Installing PNP Devices").
My component had a build order of 8550. In the parameters of the FBA
Generic Command it had a phase of 12000. This article had some good
information, but obviously not helpful enough.
http://msdn.microsoft.com/library/d...en-us/xpehelp/html/xeconfbagenericcommand.asp
Also, when the system rebooted. I got another error saying:

fba.exe - Bad Image
The Application or DLL C:\Windows\System32\RegSettings.bat is not a valid
Windows image.
Please check this against your installation diskette.

Steve
 
steve,

Use "FBA Generic Command" instead of RunOnce request to launch your batch
file. It will give you more control over the FBA phase for the command. I'd
suggest you to set late FBA phase (>8499) for your batch script to make sure
it will run properly.

Also, you may use StartUp items (All Users or Administrator) to launch your
batch. This way you know for sure when and how the script gets launched.
 
steve,

To launch .bat file you will need CMD in your image. Also, your FBA Generic
Command will have actually to run CMD (FilePath) and pass "/C
<you_batch_path>" as the command Arguments.

I don't see any connection between your component (if you set FBA phase to
12000) and "Installing PNP Devices" FBA phase. So, you might have anotehr
problem in your image (check FBALog.txt).
 
KM

CMD is part of my image. Here's some info I got from the FBALog.txt

..
..
21:45:35 PM - [FBALaunch] C:\WINDOWS\System32\RegSettings.bat (ExitCode:
0x0)
..
..
..
21:53:24 PM - [FBASetProgressText] Installing Components...
22:01:39 PM - [FBACallEntryPoint]
LoadLibrary(C:\WINDOWS\SYSTEM32\RegSettings.bat) (Error: 0xc1)
22:01:39 PM - [FBASetProgressText] Resetting Setup Flag...
22:01:40 PM - [FBADoReboot] Sleeping...
22:01:50 PM - [FBADoReboot] Rebooting system...

These last 5 lines were the last 5 lines in the log file.

Also, I shouldn't have to CMD (filePath) "/C <my_batch_file> to run a
command, because the way I'm currently doing it is executing the commands
just fine. The problem is the fact that Windows Script Host, and other
possible needed programs, are not installed yet. Therefore, it's an issue
of priority of when my component is built into the image. My main question
is how can I set my component to be built, executed, etc... after basically
the whole Operating System has been built. I appreciate your help and
input.

Steve
 
steve,

0xc1 error code you see is most likely "<.... .bat> is not a valid Win32
application." which tell me it should be run with CMD specified as I
mentioned previously.

You may place "pause" statements in your batch file to see if, how and when
it gets launched.

Have you look at the link I sent you in previous post? FBA Generic Command
is the controllable way for you to set up the command run time (use FBA
Phase property). The component build order wouldn't be so important for you
now.

--
KM,
BSquare Corporation

KM

CMD is part of my image. Here's some info I got from the FBALog.txt

.
.
21:45:35 PM - [FBALaunch] C:\WINDOWS\System32\RegSettings.bat (ExitCode:
0x0)
.
.
.
21:53:24 PM - [FBASetProgressText] Installing Components...
22:01:39 PM - [FBACallEntryPoint]
LoadLibrary(C:\WINDOWS\SYSTEM32\RegSettings.bat) (Error: 0xc1)
22:01:39 PM - [FBASetProgressText] Resetting Setup Flag...
22:01:40 PM - [FBADoReboot] Sleeping...
22:01:50 PM - [FBADoReboot] Rebooting system...

These last 5 lines were the last 5 lines in the log file.

Also, I shouldn't have to CMD (filePath) "/C <my_batch_file> to run a
command, because the way I'm currently doing it is executing the commands
just fine. The problem is the fact that Windows Script Host, and other
possible needed programs, are not installed yet. Therefore, it's an issue
of priority of when my component is built into the image. My main question
is how can I set my component to be built, executed, etc... after basically
the whole Operating System has been built. I appreciate your help and
input.

Steve

KM said:
steve,

To launch .bat file you will need CMD in your image. Also, your FBA Generic
Command will have actually to run CMD (FilePath) and pass "/C
<you_batch_path>" as the command Arguments.

I don't see any connection between your component (if you set FBA phase to
12000) and "Installing PNP Devices" FBA phase. So, you might have anotehr
problem in your image (check FBALog.txt).
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/xpehelp/htm
yet.
And built.
You
 
Back
Top