question

DanilSchiffers-5970 avatar image
0 Votes"
DanilSchiffers-5970 asked AndreasBaumgarten commented

Can't create a shortcut using a GPO.

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


[1]: /answers/storage/attachments/131223-untitled.png

[2]: /answers/storage/attachments/131168-gpresult.png

windows-group-policy
untitled.png (55.7 KiB)
gpresult.png (63.8 KiB)
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

DanilSchiffers-5970 avatar image
0 Votes"
DanilSchiffers-5970 answered AndreasBaumgarten commented

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.

· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi @DanilSchiffers-5970 ,

it's a computer policy you configured?

If so ... as far as I know/remember: The computer policy settings are applied before the user is logged in (when computer is starting/booting). Which means: The %localappdata% variable shouldn't work because this is build to the user after he logged in.


(If the reply was helpful please don't forget to upvote and/or accept as answer, thank you)

Regards
Andreas Baumgarten


0 Votes 0 ·
LimitlessTechnology-2700 avatar image
0 Votes"
LimitlessTechnology-2700 answered

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://docs.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 : )

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.