• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1014
  • Last Modified:

Batch file to delete a desktop shortcut

I recently created a batch script that runs on logon, and it copies a shortcut to the desktop of the all users profile.

I want to delete this shortcutr and cannot get a batch script to work.. Any ideas?

Thank you!
0
nsalamerica
Asked:
nsalamerica
  • 6
  • 3
  • 2
  • +3
2 Solutions
 
ZahersyedCommented:
0
 
nsalamericaAuthor Commented:
Tried this earlier. No good,......
0
 
L3370Commented:
Permissions problem?  If the script is run under a user without admin rights it could be problematic.
0
Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
nsalamericaAuthor Commented:
the users have no admin rights....... any way to do it without admin rights?
0
 
nsalamericaAuthor Commented:
Actually just tried this again from a domain admin account, and still no good.....
0
 
L3370Commented:
no admin rights will be an issue. They will not be able to do this. However if you are still having problems with Domain admin, then there is something else wrong.

This batch script runs at logon... Does this mean that the script is saved locally to that computer, and it executed in the startup process? Or does it mean that you have this added into the user's logon script?

If it is saved locally, double check that Domain Admins are in fact listed as local admins, slim chance this is the problem, but if you are using that script Zahersyed linked to it should work.

If you added this to the logon script, make sure this script applies to the proper set of users including domain admins

0
 
nsalamericaAuthor Commented:
I am using it as a logon script through group policy.
0
 
johnb6767Commented:
del /F /Q "%allusersprofile%\Desktop\Shortcut.lnk"

No reason that shouldnt work.....

Try it in a Machine Startup Script. Restricted users cant modify that location, even in a login script....
0
 
nsalamericaAuthor Commented:
Still no good...
0
 
nsalamericaAuthor Commented:
OK - it sems to work from my domain admin account now.. Anyway to make this work on a machine with no admin rights? I have about 130 of them!!
0
 
johnb6767Commented:
See my last remark, RE: Machine startup script......
0
 
johnb6767Commented:
Or PsExec.....
0
 
Guillermo FeijóoSystems administratorCommented:
PsExec has always worked fine for me. Easy to deploy and to use. It allows to execute processes with user validation, so maybe you can make the script to run under domain admin credentials. This way it should work.
0
 
oldmanhardingCommented:
Is the profile created in the specific user's desktop folder, or under the "all users" folder?
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Microsoft Azure 2017

Azure has a changed a lot since it was originally introduce by adding new services and features. Do you know everything you need to about Azure? This course will teach you about the Azure App Service, monitoring and application insights, DevOps, and Team Services.

  • 6
  • 3
  • 2
  • +3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now