Group Policy Shortcuts
-
Wednesday, February 13, 2008 4:05 AMI am trying to use the Shortcuts extension in the Computer Configurations section to create some links, but any File System Object shortcuts fail with:
The computer '<Name> preference item in the '<Policy> {GUID}' Group Policy object did not apply because it failed with error code '0x80070002 The system cannot find the file specified.' This error was suppressed.For troubleshooting, I tried the following:
- Action: Update
- Name: Explorer
- Type: File System Object
- Location: All Users Desktop
- Target: %SystemRoot%\Explorer.exe
- Args: <Blank>
- Start In: %SystemDrive%
- Shortcut: None
- Run: Normal Window
- Comment: <Blank>
- Icon File: <Blank>
- Icon Index: <Blank>
All Replies
-
Wednesday, February 13, 2008 7:14 AMModerator
Hi,
With the settings provided, I make a test in my environment and it works well.
Commonly, when the 'Target' is pointed to a non-existed file, Event 4098 that you encountered will be logged to show that the system cannot find the file specified. Please make sure that the directory in 'Target' is correct.
May I know whether the issue occurs on other shortcut policies or specifically on this one?
Miles Li
Microsoft Online Community Support
-
Wednesday, February 13, 2008 7:49 AM
I have five shortcuts within the same GPO, none of which are working. They all have "Item-level targeting" enabled, with a single File Match item. This filter tests if the path in the shortcuts target exists, so the fact that I get the event (and that I can copy/paste the target into a run box) would seem to indicate that target does in fact exist.
For testing, I have created additional shortcut items with no targeting to targets that exist on every machine (for example %SystemRoot%\System32\mmc.exe), they produce the same errors.
-
Wednesday, February 13, 2008 9:21 AMModerator
Hi,
For the specific issue, I’d like to collect more information to narrow down the problem.
1. Have you tried out other shortcuts like URL shortcuts? Are these shortcuts work properly?
2. For File System Object shortcuts, try to type a directory in the 'Target' attribute without a system environment variables path(like %systemroot%). And check how it works.
For example:
Action: Update
Type: File System Object
Location: All Users Desktop
Target: c:\windows\explorer.exe
Thanks for your time.
-
Wednesday, February 13, 2008 11:25 AM
What about trying to hit F3 in the Target path field and selecting the %SystemDir% or %WindowsDir% variable instead? I don't see %Systemroot% listed as a default value, but %SystemDir% should do the same? Remember to select "Resolve Variable".
However, I gotta say the %SystemRoot%\Explorer.exe works here too....
Best regards
Jakob H. Heidelberg
-
Wednesday, February 13, 2008 1:02 PM
URLs work.
C:\Windows\System32\MMC.exe does work.
%SystemDir%\System32\MMC.exe does not work.
-
Friday, February 15, 2008 10:51 AMModerator
Hello,
Thanks for Zilent's information.
It is recommended we use the following variables (you can get this list box by hitting F3 in the dialog):
Variable Typical Value
%WINDOWSDIR% C:\windows
%SYSTEMDRIVE% C:\
%SYSTEMDIR% C:\windows\system32
Hope it works.
-
Sunday, February 17, 2008 9:55 PMcmd.exe output...
C:\>Echo %WINDOWSDIR%
%WINDOWSDIR%
C:\>Echo %SYSTEMDRIVE%
C:
C:\>Echo %SYSTEMDIR%
%SYSTEMDIR%
C:\>Echo %SYSTEMROOT%
C:\Windows
C:\>Echo %WINDIR%
C:\Windows
I guess its not working because those variables are not defined... Question is why would those not be defined on a default istall of the OS? -
Friday, February 22, 2008 11:59 AMModerator
Hi,
No, it should not be an expected behavior that system variables are not set by default. I have verified this on cleanly installed Windows Server 2008 computers.
So, could you let me know the following?
1. Is it a cleanly installed Windows Server 2008 system, or a
2. Did you check system variables immediately after the installation?
3. By the way, the echo command may not be accurate. So, do the shortcut policy settings (with "%WINDOWSDIR% and %SYSTEMDIR%" variables) still work there on your computers?
-
Tuesday, June 30, 2009 1:58 PM
I am also having this issue with shortcut preferences that point to a file on a MAPPED DRIVE.
If I point the preference to the UNC, this works fine - however as the file I am pointing to is a flash file and flash files to do not work correctly via UNC due to the flash security model, I have to use a mapped drive.
As the user who logs in has the drive in question mapped (via preferences item) and can access everything on that drive, it seems the shortcut prefernce isn't seeing the mapped drive, despite it being processed and mapped BEFORE the shortcut preference kicks in.- Proposed As Answer by Martin Horton Saturday, February 06, 2010 7:50 PM
-
Tuesday, June 30, 2009 2:51 PM
Never mind, looks like you need to create a shortcut to a shell object, rather than a file system object, if you are pointing a shortcut to something on a network drive.- Proposed As Answer by Shaun Crossley Wednesday, December 02, 2009 10:19 PM
-
Saturday, February 06, 2010 7:50 PMI just read this entire thread an then noticed Steven Burrows thread suggesting that I needed to make the target a Shell Object rather than a File System Object and it worked. I was so happy with my test case that I went to the clients site and set about doing it for real. When yo specify the target as a Shell Object you are FORCED to browse for an object, but sadly, you can't browse for a Distributed File System Share.
So my question is if I want the target to be a DFS share, how do I do that? -
Tuesday, October 05, 2010 10:20 PM
Hi Martin,
Did you find a solution for this problem? We are experiencing the same kind of errors:
- dfs share
- same event id (4098)
- Some shortcuts work, some dont.
- Even have a shortcut pointing to a local file without getting it to work
Please reply as I desperately need this to work ;)
regards
Andreas
Andreas -
Thursday, October 28, 2010 5:04 AM
Hi Guys,
So I successfully found my way through the twisted logic of the GPP settings for creating shortcuts...
Problem I have now is because I have to use a Target Type of Shell Object, I can't add in an arguement to run in my shortcut.
ie: the target in a manually created shortcut is as follows:
"c:\program files\program folder\program.exe" arguement
but I can not place an arguement in now I have it set to Shell Object. The shortcut creates fine and others that do not require an arguement behave as expected.
Any idea's on how I can add an arguement in?
Daniel
-
Tuesday, December 07, 2010 10:19 PM
Hi All,
Encounted this problem when trying to deploy network shortcut to certain computers via GPP. The UNC path of the network shortcut had custom permissions, meaning Authenticated users which includes, "Domain Computers" had been removed. We created a custom security group containing the relevant computer accounts and allowed RX rights.
GPupdate /force and shortcut now appears. Using File system object, not shell Object or url. :)
Hugh Stuart
- Proposed As Answer by c71clark Saturday, June 30, 2012 4:48 PM
-
Friday, May 20, 2011 10:11 AM
Hi there
You're right hugh, that will work... but imho that couldn't really be the way to go because every client will do a secound gpupdate (the first is processed at the login) and this could double the load for the Domain Controllers. I'm sure the Network Drive is mapped before the shortcut will be created, the order of the gpo's in the OU is correct.
So thats an evil bug which should be fixed at microsoft or at least there should be a description about that behaviour (e.g. The file system shortcuts only work with UNC path), thats what i think about it. I'll have to try the shell object shortcut and see if it works. For my actual shortcuts it'll be no real problem if i have to use unc paths, but i'm always think forward to the case if we have to change a server (or his hostname) i've got to change every single shortcut and if it would work with Mapped Drive Characters, i'll only have to change the Drive Mapping and everything is fine again...So dear Microsoft, please try to do something about it (fix this behaviour or as mentioned above, describe this tricky thing in the description).
-
Monday, May 23, 2011 8:45 PMI found this page pretty helpful. Particularly the Additional Considerations. Hope it helps.
-
Tuesday, May 24, 2011 5:45 AMThanks for the link, but i knew how it works. And it will work, if the mapped drives are there and u make a gpupdate, but somehow the gpp doesn't map it, if you also map the drives with a gpp, even if this mapping gpp processes before the shortcut gpp and THAT is exactly the little bug (imho) :) But i make Shell Object Shortcuts and this works great, so i'll take shell object shortcuts for everything except URLs, forget the hole windows path shortcuts part, it doesn't work as excepted (with mapped drives).
-
Friday, August 05, 2011 3:27 AM
Hi Daniel,
I figured out how to use the File System Object method and have arguments as well.
Here's how:
- You MUST use the F3 option for all fields to use system variables
- Name: (Press F3) select the option you want, then manually type in the remainder of the text you need (Don't use the browse button!)
- Target type: Choose File System Object
- Location: (Press F3) select the option you want, then manually type in the remainder of the text you need (Don't use the browse button!)
- Target Path: (Press F3) select the option you want, then manually type in the remainder of the text you need (Don't use the browse button!)
- Arguments: type in whatever you need else leave it blank
- Start in: (Press F3) select the option you want, then manually type in the remainder of the text you need (Don't use the browse button!)
- Set any other options and add a comment if required
- Icon file path: (Press F3) select the option you want, then manually type in the remainder of the text you need (Don't use the browse button!)
That's It! Enjoy!
Jason Dennis
Melb - Australia- Proposed As Answer by DEJ710 Friday, August 05, 2011 3:28 AM
-
Friday, August 05, 2011 3:29 AM
Hi Andreas,I figured out how to use the File System Object method and have arguments as well.
Here's how:
- You MUST use the F3 option for all fields to use system variables
- Name: (Press F3) select the option you want, then manually type in the remainder of the text you need (Don't use the browse button!)
- Target type: Choose File System Object
- Location: (Press F3) select the option you want, then manually type in the remainder of the text you need (Don't use the browse button!)
- Target Path: (Press F3) select the option you want, then manually type in the remainder of the text you need (Don't use the browse button!)
- Arguments: type in whatever you need else leave it blank
- Start in: (Press F3) select the option you want, then manually type in the remainder of the text you need (Don't use the browse button!)
- Set any other options and add a comment if required
- Icon file path: (Press F3) select the option you want, then manually type in the remainder of the text you need (Don't use the browse button!)
That's It! Enjoy!
Jason Dennis
Melb - Australia- Proposed As Answer by DEJ710 Friday, August 05, 2011 3:29 AM
-
Wednesday, August 24, 2011 11:30 AM
hi i am bhaskar,
i have a domain controller with 2008 32-bit enterprise edition and client OS is windows xp.i want to restrict them not to use UNC path so i removed Run command so it will automatically restrict the users not to use UNC path.it wont allow to enter UNC path.but my client users want to check ping or other commands in command prompt so i want to put shortcut of command prompt (cmd.exe) on their desktops using GPO.every time users logs in it should show shortcut on their desktop.using scripts or shortcuts option in the GPO.so can you clearly tell me how to do that ? what i have to enter in the fields.is there any other way to restrict users not to use UNC path instead of hiding RUN command ?
Bhaskar -
Wednesday, August 24, 2011 1:53 PM
Hi Bhaskar
Where or why would you restrict unc paths for users? I think when you remove the CMD shortcut/usage, then you're only restricting users using UNC paths inside a CMD window/command... but when they open a windows explorer and type in the adressbar \\unc-path\share\xyz it still works.
So where and why would you restrict unc paths?
Greetz
-
Monday, September 26, 2011 12:24 PM
I believe I've found a workaround:-
It it possible to create a shortcut to a shortcut, so use GPP to create a UNC shortcut to a .lnk file which, in turn, targets the app.
I have an app that must run via a mapped drive and have parameters. It appears that GPP shortcuts cannot always target mapped drives (for whatever reason).
In the folder containing the target .exe file, I created a .lnk shortcut pointing to the .exe through the mapped drive (V:\share\folder\app.exe parameters). This shortcut file also has the parameters in it.
In GPP I created a shortcut with the target being the UNC path to the .lnk file I created above (\\unc.path\share\folder\shortcut_to_app.lnk).
It appears to work with no errors.
- Edited by LeeOliver-UWS Monday, September 26, 2011 12:52 PM
-
Wednesday, March 14, 2012 6:16 PM
LeeOliver-UWS,
Your workaround worked perfectly for me. A shortcut inside a shortcut! Nice going. This helps a lot.
-
Wednesday, June 13, 2012 5:58 PM
Try this:
Target path: \\<ServerName>\<FolderName>
Start in: \\<ServerName>
MMM
-
Saturday, June 30, 2012 4:50 PM
This was the ticket for me as well. Everything was correctly set up in the GPO, but the folder had weird permissions, and this prevented the shortcut from being created. I figured out how to get people the correct permissions to see the folder/contents, and my Shell Object shortcut popped up no problem!
-
Thursday, July 05, 2012 8:20 AM
Hi Stephan and other interested Admins,
I experienced the same problem with shortcuts (to files on mapped drives only) just created appr. every 3rd login. After changing from File System Object to Shell Object the shortcut is now properly created after login.
Thanks a lot to Steven Burrows who I think pointed first to this solution and also to all other admins in this forum for their helpful information.
Regarding the missing option to enter an argument for a Shell Objetct, I found a workaround that seems to work at least in my environment.
- Map the network path by using the same path letter which the user will get by GPP.
- Create the shortcut by using the target type "File System Object" and enter the argument you need.
- Now change the target type to "Shell Object" and browse to the target file on mapped drive.
The Arguments box will change to be greyed out and you are not able to change the value but the argument is still in.
Configure the rest of your shortcut as needed and click on OK.
Thats all! Try it and enjoy.
The shortcut is created. You are not able to see the argument in the Properties dialog of the shotcut, but it is still using it.
In one of my cases for example, I'm linking to a special version of Java.exe on a network drive to open a *.jar file in another App folder on this network drive.
I hope it will help some of you !!
Dirk
from Germany

