Question Locked

Batch Help

0 helpful
3 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

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

3 replies

by bizzo

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"
)
-------------------------------

by patb071

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

This discussion is closed to new replies.