D
D
dimaguru2015-12-02 17:08:10
cmd/bat
dimaguru, 2015-12-02 17:08:10

How to add Startup Script to Windows Server?

Hello. Tell me how to correctly issue a Startup Script that is saved in / tmp / firstboot.exec and executed when the system boots. Script to install chrome via chocolatey.org
Here are the scripts themselves
@powershell -NoProfile -ExecutionPolicy Bypass -Command "iex ((new-object net.webclient).DownloadString(' https://chocolatey.org/install.ps1 '))" && SET PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin (chocolatey install)
choco install googlechrome (chrome install)
1(install confirmation)
start chrome.exe (chrome launch)

How to arrange everything so that everything works. I tried to leave @powershell -NoProfile -Execution ... then everything is installed without problems, then I manually enter choco install googlechrome and the installation goes on, and if I place all the scripts, then nothing works. Thanks

Answer the question

In order to leave comments, you need to log in

1 answer(s)
J
Janus74, 2015-12-21
@Janus74

Are ps scripts allowed on the system? get-ExecutionPolicy
in your script is running the script https://chocolatey.org/install.ps1- THIS IS VERY DANGEROUS
Site owners can slip a virus or something.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question