Solved

shortcuts on desktops

Posted on 2016-10-19
14
61 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
 

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
What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

 

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

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

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

When you try to share a printer , you may receive one of the following error messages. Error message when you use the Add Printer Wizard to share a printer: Windows could not share your printer. Operation could not be completed (Error 0x000006…
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.
This Micro Tutorial will teach you how to the overview of Microsoft Security Essentials. This is a free anti-virus software that guards your PC against viruses, spyware, worms, and other malicious software. This will be demonstrated using Windows…
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…

910 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

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now