Solved

using a script to delete a single file from multiple workstations

Posted on 2009-07-01
3
359 Views
Last Modified: 2012-06-22
hi i am trying to delete a single file from multiple workstations. i figured this might be easier if i used a script. anyone have a script that can handle this ?
0
Comment
Question by:chaz21
  • 2
3 Comments
 
LVL 40

Accepted Solution

by:
Kyle Abrahams earned 500 total points
ID: 24757554
as long is it's in the same path you can do this with 2 bat files:

bat file 1:  Named mydel.bat
del \\%1\C$\  < y.txt

bat file 2:
mydel workstation1
mydel workstation2

y.txt: - simple character "Y" to import the Yes for delete.
y


You could do this with a VB script if you just had a list of workstations already listed, but assuming your doing this from scratch.  



0
 
LVL 40

Expert Comment

by:Kyle Abrahams
ID: 24757561
note you need to change the path of the del command.
0
 
LVL 2

Expert Comment

by:candyman2112
ID: 24768702
If you run a logon script, and it's a basic batch file, you could add this command to do the delete:

e.g. to delete the file test.txt on the C:\ drive if it exists.....
IF EXIST c:\test.txt DEL c:\test.txt /F /Q

If your logon script uses a different scripting language, it must also be possible to run a similar command.

0

Featured Post

Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

Question has a verified solution.

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

Follow this checklist to learn more about the 15 things you should never include in an email signature from personal quotes, animated gifs and out-of-date marketing content.
This process describes the steps required to Import and Export data from and to .pst files using Exchange 2010. We can use these steps to export data from a user to a .pst file, import data back to the same or a different user, or even import data t…
In this video we show how to create a Distribution Group in Exchange 2013. We show this process by using the Exchange Admin Center. Log into Exchange Admin Center.: First we need to log into the Exchange Admin Center. Navigate to the Recipients >>…
In this video we show how to create a mailbox database in Exchange 2013. We show this process by using the Exchange Admin Center. Log into Exchange Admin Center.: First we need to log into the Exchange Admin Center. Navigate to the Servers >> Data…

825 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