Solved

using a script to delete a single file from multiple workstations

Posted on 2009-07-01
3
337 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 39

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 39

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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Disabling the Directory Sync Service Account in Office 365 will stop directory synchronization from working.
Marketers need statistics and metrics like everybody else needs oxygen. In this article we explain how to enable marketing campaign statistics for Microsoft Exchange mail.
In this video we show how to create an Accepted Domain 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 Mail Flow >> Ac…
To add imagery to an HTML email signature, you have two options available to you. You can either add a logo/image by embedding it directly into the signature or hosting it externally and linking to it. The vast majority of email clients display l…

706 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

11 Experts available now in Live!

Get 1:1 Help Now