Solved

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

Posted on 2009-05-11
4
536 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
  • 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 68

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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

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…
Use this article to create a batch file to backup a Microsoft SQL Server database to a Windows folder.  The folder can be on the local hard drive or on a network share.  This batch file will query the SQL server to get the current date & time and wi…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

757 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

19 Experts available now in Live!

Get 1:1 Help Now