Solved

delete folder on multiple computers

Posted on 2013-10-28
3
343 Views
Last Modified: 2013-11-18
I need a script or program which can be used to delete a folder (C:\folder1) on multiple computers in our domain.
Could you please help me.
Most of my workstations are XP sp3
0
Comment
Question by:dedri
  • 2
3 Comments
 
LVL 13

Expert Comment

by:Daniel Helgenberger
ID: 39606120
Use a domain admin account, and create a text file with one computername per line. You can easily do so with
net view>computers.txt

Open in new window

Then, run a script iterating over the file:
SET DELTEME=mydir
FOR /F "eol=;" %%M in (computers.txt) do (
     RMDIR /S /Q "%%M\c$\%DELTEME%"
)

Open in new window


The file would be on drive C: for instance, accessed via the admin share c$
0
 

Author Comment

by:dedri
ID: 39616109
the script gives an error:

C:\temp\ExecMC>(RMDIR /S /Q "computer1\D$\folder1" )
The system cannot find the path specified.

Probably we need to add somehow "\\" before computer name?
0
 
LVL 13

Accepted Solution

by:
Daniel Helgenberger earned 500 total points
ID: 39616262
Probably we need to add somehow "\\" before computer name?
You assume correct if you did not generate the computer list as mentioned above. Please modify the script if you use plain names:
SET DELTEME=mydir
FOR /F "eol=;" %%M in (computers.txt) do (
     RMDIR /S /Q "\\%%M\c$\%DELTEME%"
)

Open in new window

Note, I just added the ''\\".
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Windows Server Backup Destination Size Limitation 8 76
Bootable media from MDT 3 32
how to execute all sub dir 2 26
PCAnywhere 2 58
Citrix XenApp, Internet Explorer 11 set to Enterprise Mode and using central hosted sites.xml file.
In this article, I will show you HOW TO: Install VMware Tools for Windows on a VMware Windows virtual machine on a VMware vSphere Hypervisor 6.5 (ESXi 6.5) Host Server, using the VMware Host Client. The virtual machine has Windows Server 2016 instal…
This video Micro Tutorial explains how to clone a hard drive using a commercial software product for Windows systems called Casper from Future Systems Solutions (FSS). Cloning makes an exact, complete copy of one hard disk drive (HDD) onto another d…
With the advent of Windows 10, Microsoft is pushing a Get Windows 10 icon into the notification area (system tray) of qualifying computers. There are many reasons for wanting to remove this icon. This two-part Experts Exchange video Micro Tutorial s…

760 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

23 Experts available now in Live!

Get 1:1 Help Now