Solved

shortcuts on desktops

Posted on 2016-10-19
14
65 Views
Last Modified: 2016-10-21
Hi,

is there any way to delete  the shortcuts on user desktops for documents and desktop.  can this be done via GPO or scripting?

some users have shortcuts of their dekstops and documents which points to an old location of home folders on a share.

desktop and documents are redirected to users home folders which we changed the path for. however, noticed some users have shortcuts which points to old location...

what is best option to remove users shortcuts for one time only so that they can create shourtcuts again if they want to as after deleting desktop and my document shourcuts, new short cut would be pointing to new location...

servers are 2012 and desktops are windows 7
0
Comment
Question by:kuzum
  • 8
  • 6
14 Comments
 
LVL 5

Expert Comment

by:Austin Texas
ID: 41851137
If you redirect the desktop to a server share, you can set the share permissions to Read.

When redirecting, redirect all users to the same location and ensure the option 'Grant user exclusive rights to <folder>' is unticked.
0
 

Author Comment

by:kuzum
ID: 41851171
Hi Tex

I did not understand your comment sorry. desktops are redirected to a new share with no issue. Issue is with those users who has shortcuts of their desktops and documents which is pointing to old location. so solution I need needs to delete short cuts on users desktops for desktop and documents.

when new shortcuts are created it will be automatically pointing to new location.
0
 
LVL 5

Expert Comment

by:Austin Texas
ID: 41851190
My apologies, maybe I misunderstood the precise goal. My previous instruction was to give all the users a clean desktop and prevent them from saving anything to it.

If you just want to delete shortcuts from desktops, you can do that with a batch file. Windows shortcuts have the extension .lnk so if you run "del %HOMEPATH%\Desktop\*.lnk" in a login script, that should get rid of all the user created shortcuts.

Let me know if that is what you are needing.
0
Is Your AD Toolbox Looking More Like a Toybox?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

 

Author Comment

by:kuzum
ID: 41851194
thanks Tex.

so we are now on same line.
del %HOMEPATH%\Desktop\*.lnk"     what does %homepath" do exactly? could you please help me to understand and may be learn form this.  can I add documents folder in here too?
0
 
LVL 5

Expert Comment

by:Austin Texas
ID: 41851201
%HOMEPATH% is a system environment variable that defines the file system path to the current user's home directory.

For example, if my username were "texas" then when %HOMEPATH% is used in a batch script, it will resolve to "\users\texas" (depending on the version of Windows) and so "del %HOMEPATH%\Desktop\*.lnk" would become "del \users\texas\Desktop\*.lnk"

This is used so that one command can be used in a login script and work for different users with different paths to their home directory.

Did I explain it well enough? I can try again if you need me to.
0
 
LVL 5

Expert Comment

by:Austin Texas
ID: 41851221
One thing I forgot! Put the path in quotes!
Like this:
del "%HOMEPATH%\Desktop\*.lnk"

Open in new window

And yes, you can include any other folders, however you might need to include the /S switch to tell the command to drill down into subfolders.
example:
del /S "%HOMEPATH%\Documents\*.lnk"

Open in new window

0
 

Author Comment

by:kuzum
ID: 41851222
thanks Tex, so do I need two one for desktop and one for documents?
0
 

Author Comment

by:kuzum
ID: 41851225
thanks Tex, Just read your last post. I will test this and let you know.
0
 
LVL 5

Accepted Solution

by:
Austin Texas earned 500 total points
ID: 41851226
Two commands; One login script.
login.bat
del "%HOMEPATH%\Desktop\*.lnk"
del /S "%HOMEPATH%\Documents\*.lnk"

Open in new window

0
 
LVL 5

Expert Comment

by:Austin Texas
ID: 41851231
One more tip: Before I run a "del" command, I first like to run it with "dir" instead so that I can verify it is going to do what I am expecting it to before I start erasing data.
0
 

Author Comment

by:kuzum
ID: 41851237
when you say deleting the data, do you mean the content of the shortcuts?

what I need to delete is simply the shortcut icons not the content. hope I'm not confusing you?
0
 
LVL 5

Expert Comment

by:Austin Texas
ID: 41851244
Right.
Just the shortcut.
Not the file that the shortcut is pointing to.

To be clear, the shortcut is a file, it is just a file that points to another file. You will be deleting files but they will be shortcut files, not the files they point to.
0
 

Author Closing Comment

by:kuzum
ID: 41854498
it worked thanks.
0
 
LVL 5

Expert Comment

by:Austin Texas
ID: 41854511
Hooray!  Let me know if you have any other login-scripty stuff you need help with.
0

Featured Post

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Possible fixes for Windows 7 and Windows Server 2008 updating problem. Solutions mentioned are from Microsoft themselves. I started a case with them from our Microsoft Silver Partner option to open a case and get direct support from Microsoft. If s…
By default the complete memory dump option is disabled in windows . If we want to enable the complete memory dump for a diagnostic purpose, we have a solution for it. here we are using the registry method to enable this.
The viewer will learn how to successfully create a multiboot device using the SARDU utility on Windows 7. Start the SARDU utility: Change the image directory to wherever you store your ISOs, this will prevent you from having 2 copies of an ISO wit…
With the advent of Windows 10, Microsoft is pushing a Get Windows 10 icon into the notification area (system tray) of qualifying computers. There are many reasons for wanting to remove this icon. This two-part Experts Exchange video Micro Tutorial s…

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question