Startup script Not executed on Windows Server

SP 61 Reputation points
2021-01-12T05:50:42.46+00:00

Newbie here. Using Windows Server 2019, I copied over my bat file to "C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Startup" and did a restart. my bat file is supposed to ping another machine. However, the startup scripts are not executed unless I login into the machine.

However, if I add the same file to "GPO -> Computer Configuration" and restart, it is working fine. Is this the only way to do this without anyone logging in? If so, is there any powershell script to do it.

Thanks a Ton

Windows for business Windows Server User experience PowerShell
Windows for business Windows Server User experience Other
0 comments No comments
{count} votes

Accepted answer
  1. Anonymous
    2021-01-12T14:26:13.877+00:00

    Yes, adding the script via the group policy editor is the correct method.
    https://learn.microsoft.com/en-us/previous-versions/windows/it-pro/windows-server-2012-r2-and-2012/dn789190(v=ws.11)

    --please don't forget to Accept as answer if the reply is helpful--


1 additional answer

Sort by: Most helpful
  1. Anonymous
    2021-01-12T16:35:32.217+00:00

    Give this one a go,
    https://superuser.com/questions/1325592/programmatically-create-machine-startup-script-in-local-group-policy-script-exe

    --please don't forget to Accept as answer if the reply is helpful--

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.