Solved

delete folder on multiple computers

Posted on 2013-10-28
3
364 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

Portable, direct connect server access

The ATEN CV211 connects a laptop directly to any server allowing you instant access to perform data maintenance and local operations, for quick troubleshooting, updating, service and repair.

Question has a verified solution.

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

Possible fixes for Windows 7 and Windows Server 2008 updating problem. Solutions mentioned are from Microsoft themselves. I started a case with them from our Microsoft Silver Partner option to open a case and get direct support from Microsoft. If s…
In this article, I will show you HOW TO: Perform a Physical to Virtual (P2V) Conversion the easy way from a computer backup (image).
This Micro Tutorial will give you a basic overview of Windows DVD Burner through its features and interface. This will be demonstrated using Windows 7 operating system.
The Task Scheduler is a powerful tool that is built into Windows. It allows you to schedule tasks (actions) on a recurring basis, such as hourly, daily, weekly, monthly, at log on, at startup, on idle, etc. This video Micro Tutorial is a brief intro…

856 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