Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need script to delete 1 file from all network computers

Status
Not open for further replies.

macdiesel1

Technical User
Jan 22, 2009
50
US
I need to come up with a script to delete 1 file from every computer on the domain network. We have about 150 machines and I don't want to delete the file 1 at a time. Any help would be greatly appreciated. Basically I need to delete the Whoami shortcut in the startup folder on all machines. We switched from Whoami to BGInfo. Thanks again.
 
I don't want to delete the file 1 at a time
Use a GPO

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
do you use a logon script? If so, delete the file during login. Otherwise:

- Get a list of computers (- loop through list
- using the UNC path, delete the file(\\computer_name_or_ip\c$\pathtofile\file.ext)

Code:
for each objComputer in colComputers
   if file exits on objComouter then
      delete file
   end if
next


-Geates
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top