Jump to content

Copy a file and execute it


Recommended Posts

I need to:

1) copy a file during install to the Windows folder;

2) execute that file at first logon; it needs administrator privileges.

After setup completes, I made it logon automatically with the admin acount. UAC is also disabled.

The setup disk is Vista SP1 x86.

Can you tell me what tools I need and how to use them, or point to a thread that helps me?

Link to comment
Share on other sites


I figured it out, but it doesn't work as expected:

The file is an executable which installs, then asks for a restart (it needs restart).

I added the file in "install.wim", under <root>\DIR\file.exe.

To execute the file, I tried two things:

a ) Windows\Setup\Scripts\SetupComplete.cmd - %SYSTEMDRIVE%\DIR\file.exe. The file is executed, but I can't see any GUI. Just black screen and the cursor. I believe the SetupComplete makes the window hidden. This way, the only way to continue setup is to manually reset the machine.

b ) FirstLogonCommands\SynchronousCommand under Autounattend.xml - <CommandLine>%SYSTEMDRIVE%\DIR\file.exe</CommandLine>. It executes, the GUI is visible and it waits a key for restart. The problem is that after I press a key, during the time Windows "starts" the restart, Windows setup tasks begin to run (personalized settings for ...) until Windows is interrupted.

The ideal way to run setup and install the application is to start executing the file, but continue Windows setup without waiting for my program to close. After setup is complete, the GUI of the program is active and awaits pressing of a key. After that, restart.

To achieve this, I changed the execution of the file with the "start" command (<CommandLine>start %SYSTEMDRIVE%\DIR\file.exe</CommandLine>). But this time, it didn't run at all.

So what should I use to complete without interruption both Windows setup and my program?

Edited by Nick_White
Link to comment
Share on other sites

  • 2 weeks later...

Setupcomplete.cmd runs right before Load Desktop(No GUI) and can be used to complete Final Steps

Note: Commands in the Setupcomplete.cmd file are executed with local system privilege.

FirstLogonCommands http://www.msfn.org/board/FirstLogonComman...p;hl=Dreamscene

I delay starting something if I want to see it, takes about 1 1/2 mins here for GUI to load

Cleanup.cmd can be run as a final thing with reboot the PC in it. I call cleanup as last step but thats with my App

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...