Solved

shortcuts on desktops

Posted on 2016-10-19
14
77 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
Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

 

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

Edgartown IT Case Study

Learn about Edgartown's quest to ensure the safety and security of the entire town's employee and citizen data. Read the case study!

Question has a verified solution.

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

A safe way to clean winsxs folder from your windows server 2008 R2 editions
How to record audio from input sources to your PC – connected devices, connected preamp to record vinyl discs, streaming media, that play through your audio card: Vista, Windows 7, Windows 8, Windows 8.1 and Windows 10 – both 32 bit & 64.
Windows 8 came with a dramatically different user interface known as Metro. Notably missing from that interface was a Start button and Start Menu. Microsoft responded to negative user feedback of the Metro interface, bringing back the Start button a…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…

713 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