user1902346
user1902346

Reputation: 819

Windows Unattended installation - run script as specific user

I am developing Windows installation on a local computer with unattended answer file and use setup.exe. In the unattended.xml I am adding a user X with a password. I want to add a script to the installation. The script does cipher to my files in a specific folder c:\cipherfiles, and I want to run that command under user X (that user X will have the certificate for this folder).

running it using SetupComplete.cmd, LogonCommands\AsynchronousCommand, Microsoft-Windows-Setup\RunAsynchronousCommand or RunSynchronousCommand didn't work.

any idea how should I do it ? Thanks

Upvotes: 1

Views: 601

Answers (1)

Ain't a job for "RUNAS" ?

runas /user:$username <program>

or

runas /user:$username@$domain <program>

I think including this on your SetupComplete.cmd would be enough.

Upvotes: 0

Related Questions