0

I am building Windows 10 with autounattend.xml to automate Windows 10 installation.

I also trying to automate installation of programs, that will install after first login.

I create these folders x:\$OEM$\$$\Setup\scripts\ and copy SetupComplete.cmd to run at first login.

Problem is that SetupComplete.cmd is not launched as administrator (i think).

I am trying to start cmd file that is on image, witch can install all application that are in the image.

I tried with adding registry in H

KEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\RunOnce

which is not added.

Also tried adding task from command line, witch is not added. Also tried adding

HKEY_curent_user\Software\Microsoft\Windows\CurrentVersion\RunOnce

with loading hive hku, witch will add run once as default user, but that doesn't work.

How can I do this?

Jason Aller
  • 2,340
  • 6
  • 23
  • 21

1 Answers1

0

Create a scheduled task which runs at login and calls this script. You can configure it to run as administrator and it won't trigger UAC too.

If you need it to only ever run once you could make the script delete the scheduled task once it has finished.

Richard
  • 5,831
  • 9
  • 44
  • 73
  • I tried that, but task is not added. Also tried to copy install.lnk to all user startup folder, witch is shortcut to install.cmd, but i got message access denied. I believe that SetupComplete is launched as local user, and cant create tasks, copy files to system folders... – Bogdan Praščević Jul 12 '17 at 09:21