Solved

shortcuts on desktops

Posted on 2016-10-19
14
82 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Building an interactive eFuture classroom

Watch and learn how ATEN provided a total control system solution including seamless switching matrix switch, HDBaseT extenders, PDU, lighting control to build an interactive eFuture classroom.

 

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

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

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

Background Information Recently I have fixed file server permission issues for one of my client. The client has 1800 users and one Windows Server 2008 R2 domain joined file server with 12 TB of data, 250+ shared folders and the folder structure i…
I was prompted to write this article after the recent World-Wide Ransomware outbreak. For years now, System Administrators around the world have used the excuse of "Waiting a Bit" before applying Security Patch Updates. This type of reasoning to me …
This Micro Tutorial will give you a introduction in two parts how to utilize Windows Live Movie Maker to its maximum capability. This will be demonstrated using Windows Live Movie Maker on Windows 7 operating system.
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…

752 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