none
RunOnce deploy via Group Policy only on first logon RRS feed

  • Question

  • Hi,

    I have a Windows Server 2012 R2 Standard Edition and Workstations running Windows 8.1. I want group policy to deploy a bat file to RunOnce through Registry and only the first time the user logs on.

    I have ticked the box on the properties saying "Run once and only run once" but it doesn't seem to deploy. What i am trying to deploy is a Windows 8.1 Start Menu File so that the user has the start menu that I wish they to have but they can also edit it and it doesn't keep replacing with the one I want.

    I am open to answering any more questions or post pictures of my batch, group policy and registry.

    Thanks in Advance,

    ~ Zac

    Thursday, July 2, 2015 11:46 AM

Answers

  • Hi

    When you mean start menu, do you mean start screen? As I know, there is only one option to deploy a customized Start screen layout to users in a domain and prevent edit from users.

    Customize Windows 8.1 Start Screens by Using Group Policy

    https://technet.microsoft.com/en-us/library/dn467928.aspx?f=255&MSPPError=-2147217396

    Note: Start screen control is supported in the Windows 8.1 Enterprise operating system, the Windows RT 8.1 operating system with side loading enabled, and in all editions of the Windows Server 2012 R2 operating system. Start screen control is not supported in the Windows 8.1 Pro operating system and the Windows 8.1 operating system.

    For Runonce script, keep eyes on the permission of users, if your script was running by using user account but your users has no permission to run these command, it causes failure.

    Regards,

    D. Wu


    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact tnmff@microsoft.com.

    Monday, July 6, 2015 2:30 AM
    Moderator
  • Yes I did mean Start Screen Sorry, I found that option in Group Policy but it wouldn't allow the user to edit the start menu. I did solve my own problem by finding the Start Screen Files Located in %USERPROFILE%\AppData\Local\Microsoft\Windows, its the two appData.bak files that store the layout so I made a startup script to replace those files, I also used the RunOnce Registry Key to deploy it and selected Run Once in Group Policy.

    For anyone looking for the same method of Windows 8 StartMenu Deployment, follow the steps below:

    1. Customise the Start Menu that you wish to deploy on any computer

    2. Head over to "%USERPROFILE%\AppData\Local\Microsoft\Windows" and find two files called "appsFolder.itemdata-ms" & "appsFolder.itemdata-ms.bak"

    3. Copy those files into your Servers NetLogon and then into a folder called StartMenu or maybe if you have a mix of Admins and Users something like sm-admin and sm-user

    4. Open Notepad and paste the following code and edit to your servers path to the StartMenu and save it as a batch file (.bat)

    @echo off
    xcopy /y "\\SERVER\netlogon\sm-user\*" "%USERPROFILE%\AppData\Microsoft\Windows\"
    TASKKILL explorer.exe && start explorer.exe

    5. Lauch Group Policy Management Console and Create a policy called StartMenu Deployment (Or what ever you wish to call it)

    6. Head over to "User Configuration\Preferences\Windows Settings\Registry"

    7. Add a new Key: 

     Action: UPDATE

     Hive: HKEY_CURRENT_USER

     Key Path: Software\Microsoft\Windows\CurrentVersion\Runonce

     Value Name: DeployStartMenu

     Value Type: REG_SZ

     Value Data: \\SERVER\netlogon\sm-user.bat

    8. Goto the Common Tab and select/tick "Apply Once and Do Not Reapply"

    9. Apply then Ok - Close Group Policy and then "GPUPDATE /force" and log on as a new user (This also applies to current users if this policy has not been applied)


    Regards,

    Zac

    • Marked as answer by Deason WuModerator Friday, August 7, 2015 7:15 AM
    • Edited by ZDog01 Tuesday, August 11, 2015 11:05 AM Added Method
    Friday, August 7, 2015 7:09 AM

All replies

  • Hi

    When you mean start menu, do you mean start screen? As I know, there is only one option to deploy a customized Start screen layout to users in a domain and prevent edit from users.

    Customize Windows 8.1 Start Screens by Using Group Policy

    https://technet.microsoft.com/en-us/library/dn467928.aspx?f=255&MSPPError=-2147217396

    Note: Start screen control is supported in the Windows 8.1 Enterprise operating system, the Windows RT 8.1 operating system with side loading enabled, and in all editions of the Windows Server 2012 R2 operating system. Start screen control is not supported in the Windows 8.1 Pro operating system and the Windows 8.1 operating system.

    For Runonce script, keep eyes on the permission of users, if your script was running by using user account but your users has no permission to run these command, it causes failure.

    Regards,

    D. Wu


    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact tnmff@microsoft.com.

    Monday, July 6, 2015 2:30 AM
    Moderator
  • Yes I did mean Start Screen Sorry, I found that option in Group Policy but it wouldn't allow the user to edit the start menu. I did solve my own problem by finding the Start Screen Files Located in %USERPROFILE%\AppData\Local\Microsoft\Windows, its the two appData.bak files that store the layout so I made a startup script to replace those files, I also used the RunOnce Registry Key to deploy it and selected Run Once in Group Policy.

    For anyone looking for the same method of Windows 8 StartMenu Deployment, follow the steps below:

    1. Customise the Start Menu that you wish to deploy on any computer

    2. Head over to "%USERPROFILE%\AppData\Local\Microsoft\Windows" and find two files called "appsFolder.itemdata-ms" & "appsFolder.itemdata-ms.bak"

    3. Copy those files into your Servers NetLogon and then into a folder called StartMenu or maybe if you have a mix of Admins and Users something like sm-admin and sm-user

    4. Open Notepad and paste the following code and edit to your servers path to the StartMenu and save it as a batch file (.bat)

    @echo off
    xcopy /y "\\SERVER\netlogon\sm-user\*" "%USERPROFILE%\AppData\Microsoft\Windows\"
    TASKKILL explorer.exe && start explorer.exe

    5. Lauch Group Policy Management Console and Create a policy called StartMenu Deployment (Or what ever you wish to call it)

    6. Head over to "User Configuration\Preferences\Windows Settings\Registry"

    7. Add a new Key: 

     Action: UPDATE

     Hive: HKEY_CURRENT_USER

     Key Path: Software\Microsoft\Windows\CurrentVersion\Runonce

     Value Name: DeployStartMenu

     Value Type: REG_SZ

     Value Data: \\SERVER\netlogon\sm-user.bat

    8. Goto the Common Tab and select/tick "Apply Once and Do Not Reapply"

    9. Apply then Ok - Close Group Policy and then "GPUPDATE /force" and log on as a new user (This also applies to current users if this policy has not been applied)


    Regards,

    Zac

    • Marked as answer by Deason WuModerator Friday, August 7, 2015 7:15 AM
    • Edited by ZDog01 Tuesday, August 11, 2015 11:05 AM Added Method
    Friday, August 7, 2015 7:09 AM
  • I want to do the same thing in Windows 10.

    There is no "appsFolder.itemdata-ms" & "appsFolder.itemdata-ms.bak" in "%USERPROFILE%\AppData\Local\Microsoft\Windows" folder.

    So, what can I do?

    Tuesday, March 28, 2017 12:56 PM
  • I also would like to be able to do this for Windows 10 Enterprise version 1703
    Tuesday, September 19, 2017 1:57 PM