Solved

How to delete a file from all Users Desktops through a script or Kaseya

Posted on 2009-05-11
4
543 Views
Last Modified: 2012-05-06
I need a script to run that will delete a file from All Users Profiles desktops.

I would like to push this out through Kaseya but am open to other suggestions

DEL C:\Documents and Settings\HELP NEEDED HERE\Desktop\OrderForm.*

Any ideas?
0
Comment
Question by:jgould763
[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
  • 2
4 Comments
 
LVL 38

Expert Comment

by:Shift-3
ID: 24356045
If you're putting it in a logon script then you can use this command:

DEL /F /Q "%userprofile%\Desktop\OrderForm.*"

Open in new window

0
 
LVL 7

Expert Comment

by:zwei
ID: 24356242

for /d %%K in ("C:\Documents and Settings\*") do del "%%~fK\Desktop\OrderForm.*"

Open in new window

0
 
LVL 7

Accepted Solution

by:
zwei earned 500 total points
ID: 24356290
Of course you can add /F /Q to that if you want... and this needs to be put in a batch file (.bat).

/F force delete of readonly files
/Q does not ask "are you sure you want to delete?"

for /d %%K in ("C:\Documents and Settings\*") do del /F /Q "%%~fK\Desktop\OrderForm.*"

Open in new window

0
 
LVL 70

Expert Comment

by:Qlemo
ID: 24356299
For just the All Users profile, you can use this:

del /f /q "%allusersprofile%\Desktop\OrderForm.*"
0

Featured Post

Enroll in May's Course of the Month

May’s Course of the Month is now available! Experts Exchange’s Premium Members and Team Accounts have access to a complimentary course each month as part of their membership—an extra way to increase training and boost professional development.

Question has a verified solution.

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

One of my most closely kept secrets is revealed in this discussion How to output text on the same line This question was recently posted in EE by Simon336697 (http://www.experts-exchange.com/Programming/Languages/Scripting/Shell/Batch/Q_2459…
Being a system administrator some time we require to do things remotely, one of them is installing software. Here I am going to tell you how to install software through wmic (Windows management instrument console). I am not at all saying that this i…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

710 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