none
Script launched by Group policy only executed after 7-10 seconds

    General discussion

  • Dears,

    Could someone help to find out how I could resolve the following issue.

    I'm running windows server 2012 R2 via a remote desktop connection. We have a login script that we would like to be applied immediately when the desktop is shown to the end users. Currently It takes between 7 and 10 seconds before this script is launched.

    So the script is called via the following definition in the group policy. It creates an entry in the registry and this entry is executed only after 7-10 seconds.

    General

    Action

    Update

    Properties

    Hive

    HKEY_CURRENT_USER

    Key path

    Software\Microsoft\Windows\CurrentVersion\Run

    Value name

    Runlogin

    Value type

    REG_SZ

    Value data

    <Path to the file>\Login.cmd

    I have already tried to put at server level the same entry in the registry manually, I have also tried to define a local group policy by using the logon entry  (Computer configuration - administrative templates - system - Logon -Run these programs at user logon) but all my attempt failed. This simple script is just running after 7-10 seconds after the desktop is shown to the end users.

    Does anybody already encountered similar issue ? Any tips is more than welcome. 

    Thursday, January 12, 2017 12:32 PM

All replies

  • > So the script is called via the following definition in the group policy. It creates an entry in the registry and this entry is executed only after 7-10 seconds.
     
    This is expected. The Run key is evaluated by explorer.exe when it is kind of idle enough (and for sure after the desktop is populated!), and it is not a synchronous process.
    If you need sync scripts, use a real logon script.
     
    Thursday, January 12, 2017 4:35 PM
  • Thanks for the reply.

    I have also tried local group policy by using the logon entry  (Computer configuration - administrative templates - system - Logon -Run these programs at user logon)

    But it started also after 7-10 seconds.

    What do you mean by real logon script ?

    Thursday, January 12, 2017 4:38 PM
  • > What do you mean by real logon script ?
     
    User Configuration - Policies - Windows Settings - Scripts
     
    Friday, January 13, 2017 9:56 AM