Can't create a shortcut using a GPO.

Daniël Schiffers 21 Reputation points
2021-09-10T20:32:39.237+00:00

Hello everyone I'm trying to create a shortcut using a GPO. For some reason I get the 0x80070002 error code when applying my GPO.

My goal is to create a shortcut named Mailspring in %ALLUSERSPROFILE%\Microsoft\Windows\Start Menu\Programs

I added the gpresult /h and a screenshot of my gpo.

I configured this in my GPO:

name: %ALLUSERSPROFILE%\Microsoft\Windows\Start Menu\Programs\Mailspring
target type: File system object
Location: Specify full path

Target path: %LocalAppData%\Mailspring\mailspring.exe

When I use this GPO and change the target type to URL it does work.

When I change %ALLUSERSPROFILE% to C:\ProgramData and %LocalAppData% to C:\Users\tim_hui it still does not work.

Does anyone have experience with this problem? I hope I gave enough information to work with I am willing to provide more when necessary.

Thanks in advance,

Regards Daniël

Windows
Windows
A family of Microsoft operating systems that run across personal computers, tablets, laptops, phones, internet of things devices, self-contained mixed reality headsets, large collaboration screens, and other devices.
4,747 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Daniël Schiffers 21 Reputation points
    2021-09-11T13:10:09.28+00:00

    Update, For some reason the variable %localappdata% gives problems. The GPO is linked to the computerobject in a OU. But when I link it to a user I get a permission error. Changing the path from %localappdata% to C:\Users\tim_hui\AppData\Local resolves the issue but the GPO needs to apply to all my users so I need that variable working.


  2. Limitless Technology 39,351 Reputation points
    2021-09-14T10:11:25.767+00:00

    Hello DanilSchiffers,

    This 0x80070002 error code appears due to corrupted apps and when some files are missing even after the update and when files aren't extracted properly. and even due to time date issues and registry issues.

    To rectify it do try the following methods

    1. delete software distribution folders
    2. Check for your date and time
    3. Try windows update troubleshooter for GPO
    4. Try modifying Registry Editor

    If the problem persists do follow the below link for advanced methods of Group Policy, Shortcut Extensions

    https://learn.microsoft.com/en-us/internet-explorer/ie11-deploy-guide/group-policy-shortcut-extensions-ie11

    Hope this answers all your queries, if not please do repost back.
    If an Answer is helpful, please click "Accept Answer" and upvote it : )

    0 comments No comments