Batch Help

By patb071 ·
Is there a way to create a batch file to delete rdp connections off the desktop for all users? The problems is the icon is not in all users profile it is the individual users profile.

I have tried
cd \
del documents and settings\*\desktop\*.rdp

I get the error cannot find path

This conversation is currently closed to new comments.

Thread display: Collapse - | Expand +

All Answers

Collapse -

You need a batch file

by Bizzo In reply to Batch Help

This will do, but you may need to change the drive letter in line 2 which sets profileroot, and remove the echo from line 5 after you've tested it's deleting the right things:

@echo off
Set profileroot=d:\documents and settings

FOR /F "tokens=*" %%I IN ('DIR /B /AD "%profileroot%"') DO (
echo del /s /q "%profileroot%\%%I\Desktop\*.rdp"

Collapse -


by patb071 In reply to You need a batch file

We had to do some modifing of the batch but that is what we were looking for thanks

Related Discussions

Related Forums