Solved

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

Posted on 2009-05-11
4
539 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 69

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

The New “Normal” in Modern Enterprise Operations

DevOps for the modern enterprise offers many benefits — increased agility, productivity, and more, but digital transformation isn’t easy, especially if you’re not addressing the right issues. Register for the webinar to dive into the “new normal” for enterprise modern ops.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Windows Batch File - Count Down 4 87
Access Control Entries lost in Windows folders 3 56
How can i echo a ! to end of a file? 8 23
Batch: reboot servers one by one. 4 21
TOMORROW TOMORROW.BAT is inspired by a question I get asked over and over again; that is, "How can I use batch file commands to obtain tomorrow's date?" The crux of this batch file revolves around the XCOPY command - a technique I discovered w…
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…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

809 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