kuzum
asked on
shortcuts on desktops
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
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
ASKER
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.
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.
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.
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.
ASKER
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?
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?
%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.
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.
One thing I forgot! Put the path in quotes!
Like this:
example:
Like this:
del "%HOMEPATH%\Desktop\*.lnk"
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"
ASKER
thanks Tex, so do I need two one for desktop and one for documents?
ASKER
thanks Tex, Just read your last post. I will test this and let you know.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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.
ASKER
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?
what I need to delete is simply the shortcut icons not the content. hope I'm not confusing you?
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.
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.
ASKER
it worked thanks.
Hooray! Let me know if you have any other login-scripty stuff you need help with.
When redirecting, redirect all users to the same location and ensure the option 'Grant user exclusive rights to <folder>' is unticked.