Jump to content

RunOnce Program


lknt

Recommended Posts

Hello everyone,

I am customizing my Windows XP SP3 CD with nLite and here is basically what I want to do: when the setup is complete, and I log on for the first time, the autorun.exe program from the CD (that's an autorun.exe I made completely myself, nothing to do with original one) opens automatically so that I can install some extra programs which I could not have automatically installed by creating an add-on for Hotfixes. I have tried using this RunOnce command: %SOURCE%\Autorun.exe and it works fine but the program opens before the logon is complete and there is a command prompt window in background. The logon is completed when I close my program. But I want the program to open only when the logon is fully completed, how can I do that?

Any help is appreciated

Link to comment
Share on other sites


I take it you are using the function in nLite to autologon at least once, if so:

Do it with a couple of batch files, first call one from nLite's RunOnce function

%Source%Step1.bat

containing

Start %Source%Step2.bat

which calls another batch file containing

Ping -n 121 127.0.0.1 > nul
%Source%Autorun.exe

The first one will initiate the second, but critically will allow the first logon and account creation procedure to start, the ping command gives a 2 minute delay (n-1 seconds) before executing your Autorun.exe program.

EDIT: Anything in the 1st batch file will be executed before account initialisation and anything in the 2nd after.

Edited by Kurt_Aust
Link to comment
Share on other sites

If you don't want to add the two extra NT command scripts to your source, then you could alternativelly use:

ping -n 121 localhost&%source%autorun.exe

(The commands are added to NLITE.CMD and not run directly from RunOnce reg-key)

Edit: hmm, sorry - maybe the second instance is the actual key to getting the shell loaded finished... Sorry for butting in then! :)

Edited by Martin H
Link to comment
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.
×
×
  • Create New...