Run Items Without Explorer

K

kthompson

I am attempting to find a way that I can run a VBScript or a batch
file every time my image boots. This is more difficult than just
adding another Run key because I am not running explorer as the shell.
I was under the impression that in the abscence of explorer, the FBA
would process the Run items at every boot. However, testing has proved
this to be false, at least in my case. I also tried adding a RunOnce
item because a source indicated it is processed by the FBA during the
initial boot and every logon thereafter.

After some searching I am at a loss. So far I have tried setting the
Userinit key to run my script as suggested in the discussion entitled
"What runs the Run/Runonce settings ?". I have also tried adding a Run
item in TD with CMD as the filepath and batch/script included in the
arguments. This was suggested in another discussion entitled "Run
batch command after fba".

So currently I am at a loss, I want the script to run every time the
system boots and not just once during the initial FBA. For reference,
I am currectly running minlogon. I have also been testing lately with
the command shell for simplicity instead of our custom shell. Both the
command shell and the custom shell have exhibited the same symptoms I
described above.

It seems like this is a common problem, but I have not found a
resolution. Does anyone has some insight or suggestions?

Kyle
 
Joined
Nov 26, 2007
Messages
9
Reaction score
0
Your custom shell should have its own registry keys telling the OS to run your shell everytime it boots up (unless you manually start your custom shell everytime?) In the registry keys for starting the shell is where you should put the vbscript to run
 
M

Martin Grossen, eMVP [AVNET Silica]

Hi Kyle

Of course, you can not use the FBA (First Boot Agent) or
the RunOnce.
Per naming and definition, both will only processed during the first boot
of the system.
The standard RUN key in the registry will help you.
(HKLM/Software/Microsoft/Windows/Current Version/Run)
You can do this easely (to test) by adding a "Extra Registry Data" and the
batch as a "Extra File" resource int your image via Target Designer.
Of course more elegant is to cretae a own component in component designer
with the registry key and the file in a own repository.
This is the same as you can drag and drop something in the
Autostart folder of your Explorer-Shel.

The right command for the key in the registry is:

C:\System32\cmd.exe /c yourpath\yourbatch.bat

of course, you must have the component "CMD - Windows Command Processor"
included in your image.

--

Martin Grossen, eMVP

AVNET EMG Silica
Franchise Manager Microsoft Embedded Europe

Your competent partner for Microsoft Embedded licencing

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
K

kthompson

Hi Kyle

Of course, you can not use the FBA (First Boot Agent) or
the RunOnce.
Per naming and definition, both will only processed during the first boot
of the system.
The standard RUN key in the registry will help you.
(HKLM/Software/Microsoft/Windows/Current Version/Run)
You can do this easely (to test) by adding a "Extra Registry Data" and the
batch as a "Extra File" resource int your image via Target Designer.
Of course more elegant is to cretae a own component in component designer
with the registry key and the file in a own repository.
This is the same as you can drag and drop something in the
Autostart folder of your Explorer-Shel.

The right command for the key in the registry is:

C:\System32\cmd.exe /c yourpath\yourbatch.bat

of course, you must have the component "CMD - Windows Command Processor"
included in your image.

--

Martin Grossen, eMVP

AVNET EMG Silica
Franchise Manager Microsoft Embedded Europe

Your competent partner for Microsoft Embedded licencing

Martin,

Thanks for the reply. Perhaps I was not clear enough in my original
post. I am aware that the Run key should be the solution. However, the
run key does not execute when Explorer is not running as the shell. I
just tested your instructions and it does not work even when "CMD -
Windows Command Processor" is in the image. To test, I set cmd.exe as
the shell so that explorer would not run. From there I checked the
registry and the Run key was indeed set according to your
instructions, but it still had no effect.

Just a note here, I am currently trying to run a VBScript using
wscript.exe. So my run command looks like

C:\WINDOWS\system32\wscript.exe //nologo C:\test.vbs

I have also tested batch scripts using the same settings as you
describe and get the same results either way, nothing works.

Kyle
 
M

Mike Warren

kthompson said:
Thanks for the reply. Perhaps I was not clear enough in my original
post. I am aware that the Run key should be the solution. However, the
run key does not execute when Explorer is not running as the shell. I
just tested your instructions and it does not work even when "CMD -
Windows Command Processor" is in the image. To test, I set cmd.exe as
the shell so that explorer would not run. From there I checked the
registry and the Run key was indeed set according to your
instructions, but it still had no effect.


The run key is executed in my minlogon based builds so I don't know why
it is not for you.

This may give you a bit more information:

<http://groups.google.com/group/microsoft.public.windowsxp.embedded/brow
se_thread/thread/b0b78715cf46aa68/cd04fac70d006667?lnk=st&q=#cd04fac70d0
06667>
 
M

Martin Grossen, eMVP [AVNET Silica]

Interessting...

I use such commands even to load a shel.
I call this a batch shell.
Startup a batch command as Shell and at the end of the batch file,
I let my real shell strating up.

I testet the RUN Key in my minlogon image and it works fine....

No idea what can cause such an issue... :-(


--

Martin Grossen, eMVP

AVNET EMG Silica
Franchise Manager Microsoft Embedded Europe

Your competent partner for Microsoft Embedded licencing

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
K

kthompson

Alright, so I finally solved the issue. The Run key was not being
executed because I had manually set the Shell registry key in TD. So
whatever processes the Run key was not being set to do so because I
still had the Explorer Shell component in my build. It was only after
I removed the Explorer Shell and added the Command Shell, that the Run
key actually executed at every boot.

Thank you Mike, it was the link that you suggested that gave me the
idea. I checked the UserInit key in the registry and it was not set to
"C:\windows\fba\fba.exe -run" when I manually set the shell. However,
after disabling the explorer shell and adding the command shell, that
value data shows up in the Userinit key.

After a little more testing I believe that the Userinit registry key
is not the only one required to make the FBA process the Run key. I
built an image using the explorer shell and then manually set the
shell to "cmd.exe" and Userinit to "C:\windows\fba\fba.exe -run".
After doing this the run key was not executed which would inidicate
there are other things that I did not set manually. So this is not
something that I can set manually unless I know all the registry keys
that need to be set. No matter, I will just have to configure my image
a little differently from now on.

Thanks again all.

Kyle
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top