Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > VB Script

Vista - Delete all *.prf files in a certain directory on multiple computer

Reply
 
Old 10-02-2009   #1 (permalink)
Rich


 
 

Delete all *.prf files in a certain directory on multiple computer

I have a text file with one computer name per line.

What I need to do is on every one of those computers, if there are any files
with a .prf extension in
c:\program files\microsoft office\
I need to delete them.

Does anyone have a script that would do this so I don't have to do it
manually on hundreds of computers?

My System SpecsSystem Spec
Old 10-02-2009   #2 (permalink)
Rich


 
 

RE: Delete all *.prf files in a certain directory on multiple computer

Also, as i'm finding out by doing some of them manually, some of the files
are set to read-only, others aren't.

"Rich" wrote:
Quote:

> I have a text file with one computer name per line.
>
> What I need to do is on every one of those computers, if there are any files
> with a .prf extension in
> c:\program files\microsoft office\
> I need to delete them.
>
> Does anyone have a script that would do this so I don't have to do it
> manually on hundreds of computers?
My System SpecsSystem Spec
Old 10-02-2009   #3 (permalink)


Ubuntu 9.10 64 Bit
 
 

Re: Delete all *.prf files in a certain directory on multiple computer

Quote  Quote: Originally Posted by Rich View Post
Also, as i'm finding out by doing some of them manually, some of the files
are set to read-only, others aren't.

"Rich" wrote:
Quote:

> I have a text file with one computer name per line.
>
> What I need to do is on every one of those computers, if there are any files
> with a .prf extension in
> c:\program files\microsoft office\
> I need to delete them.
>
> Does anyone have a script that would do this so I don't have to do it
> manually on hundreds of computers?
Do you want to run this script from one computer and have it delete it from every other computer, or run the script on every machine instead of deleting the files?
My System SpecsSystem Spec
Old 10-02-2009   #4 (permalink)
Pegasus [MVP]


 
 

Re: Delete all *.prf files in a certain directory on multiple computer


"Rich" <richjone@newsgroup> wrote in message
news:322AD91B-5948-46E5-B7B4-5391559DCB9A@newsgroup
Quote:

> Also, as i'm finding out by doing some of them manually, some of the files
> are set to read-only, others aren't.
>
> "Rich" wrote:
>
Quote:

>> I have a text file with one computer name per line.
>>
>> What I need to do is on every one of those computers, if there are any
>> files
>> with a .prf extension in
>> c:\program files\microsoft office\
>> I need to delete them.
>>
>> Does anyone have a script that would do this so I don't have to do it
>> manually on hundreds of computers?
The simplest method would be by batch file:
@echo off
set Fld=program files\microsoft office
for /F %%a in (c:\PCs.txt) do echo del /F \\%%a\c$\%Fld%\*.prf 2>nul

Remove the word "echo" in the last line to activate the batch file. Add the
/S switch to the "del" command if you wish to process subdirectories.


My System SpecsSystem Spec
Old 10-02-2009   #5 (permalink)
Rich


 
 

Re: Delete all *.prf files in a certain directory on multiple comp

I'd just like to run it from my computer, where I'm logged in with an account
that's an admin on all the other machines.

"CrucialHoax" wrote:
Quote:

>
> Rich;1150758 Wrote:
Quote:

> > Also, as i'm finding out by doing some of them manually, some of the
> > files
> > are set to read-only, others aren't.
> >
> > "Rich" wrote:
Quote:

> > > > >
> > > > I have a text file with one computer name per line.
> > > >
> > > > What I need to do is on every one of those computers, if there are
> > > any files
> > > > with a .prf extension in
> > > > c:\program files\microsoft office\
> > > > I need to delete them.
> > > >
> > > > Does anyone have a script that would do this so I don't have to do it
> > > > manually on hundreds of computers? > >
>
> Do you want to run this script from one computer and have it delete it
> from every other computer, or run the script on every machine instead of
> deleting the files?
>
>
> --
> CrucialHoax
>
My System SpecsSystem Spec
Old 10-02-2009   #6 (permalink)
Rich


 
 

Re: Delete all *.prf files in a certain directory on multiple comp

Thanks, I will give it a try.

"Pegasus [MVP]" wrote:
Quote:

>
> "Rich" <richjone@newsgroup> wrote in message
> news:322AD91B-5948-46E5-B7B4-5391559DCB9A@newsgroup
Quote:

> > Also, as i'm finding out by doing some of them manually, some of the files
> > are set to read-only, others aren't.
> >
> > "Rich" wrote:
> >
Quote:

> >> I have a text file with one computer name per line.
> >>
> >> What I need to do is on every one of those computers, if there are any
> >> files
> >> with a .prf extension in
> >> c:\program files\microsoft office\
> >> I need to delete them.
> >>
> >> Does anyone have a script that would do this so I don't have to do it
> >> manually on hundreds of computers?
>
> The simplest method would be by batch file:
> @echo off
> set Fld=program files\microsoft office
> for /F %%a in (c:\PCs.txt) do echo del /F \\%%a\c$\%Fld%\*.prf 2>nul
>
> Remove the word "echo" in the last line to activate the batch file. Add the
> /S switch to the "del" command if you wish to process subdirectories.
>
>
>
My System SpecsSystem Spec
Old 10-02-2009   #7 (permalink)
Rich


 
 

Re: Delete all *.prf files in a certain directory on multiple comp

the paths look like they would work, but when i remove the echo, it doesn't
delete anything. do we have to do something special to get it to work with
UNC paths via the command prompt?

"Pegasus [MVP]" wrote:
Quote:

>
> "Rich" <richjone@newsgroup> wrote in message
> news:322AD91B-5948-46E5-B7B4-5391559DCB9A@newsgroup
Quote:

> > Also, as i'm finding out by doing some of them manually, some of the files
> > are set to read-only, others aren't.
> >
> > "Rich" wrote:
> >
Quote:

> >> I have a text file with one computer name per line.
> >>
> >> What I need to do is on every one of those computers, if there are any
> >> files
> >> with a .prf extension in
> >> c:\program files\microsoft office\
> >> I need to delete them.
> >>
> >> Does anyone have a script that would do this so I don't have to do it
> >> manually on hundreds of computers?
>
> The simplest method would be by batch file:
> @echo off
> set Fld=program files\microsoft office
> for /F %%a in (c:\PCs.txt) do echo del /F \\%%a\c$\%Fld%\*.prf 2>nul
>
> Remove the word "echo" in the last line to activate the batch file. Add the
> /S switch to the "del" command if you wish to process subdirectories.
>
>
>
My System SpecsSystem Spec
Old 10-02-2009   #8 (permalink)
Pegasus [MVP]


 
 

Re: Delete all *.prf files in a certain directory on multiple comp

Run this slightly modified version from a *Command Prompt*, then report what
you see on the screen.
@echo off
set Fld=program files\microsoft office
for /F %%a in (c:\PCs.txt) do echo del /F \\%%a\c$\%Fld%\*.prf


"Rich" <richjone@newsgroup> wrote in message
news:B6E8458A-84D3-4568-B210-121CE51BF360@newsgroup
Quote:

> the paths look like they would work, but when i remove the echo, it
> doesn't
> delete anything. do we have to do something special to get it to work
> with
> UNC paths via the command prompt?
>
> "Pegasus [MVP]" wrote:
>
Quote:

>>
>> "Rich" <richjone@newsgroup> wrote in message
>> news:322AD91B-5948-46E5-B7B4-5391559DCB9A@newsgroup
Quote:

>> > Also, as i'm finding out by doing some of them manually, some of the
>> > files
>> > are set to read-only, others aren't.
>> >
>> > "Rich" wrote:
>> >
>> >> I have a text file with one computer name per line.
>> >>
>> >> What I need to do is on every one of those computers, if there are any
>> >> files
>> >> with a .prf extension in
>> >> c:\program files\microsoft office\
>> >> I need to delete them.
>> >>
>> >> Does anyone have a script that would do this so I don't have to do it
>> >> manually on hundreds of computers?
>>
>> The simplest method would be by batch file:
>> @echo off
>> set Fld=program files\microsoft office
>> for /F %%a in (c:\PCs.txt) do echo del /F \\%%a\c$\%Fld%\*.prf 2>nul
>>
>> Remove the word "echo" in the last line to activate the batch file. Add
>> the
>> /S switch to the "del" command if you wish to process subdirectories.
>>
>>
>>

My System SpecsSystem Spec
Old 10-02-2009   #9 (permalink)
Rich


 
 

Re: Delete all *.prf files in a certain directory on multiple comp

it echos the right paths just as the previous version did, but now when I run
it without the echo, all i get is

The system cannot find the file specified.
The system cannot find the file specified.
The system cannot find the file specified.
The system cannot find the file specified.
The system cannot find the file specified.
The network path was not found.



"Pegasus [MVP]" wrote:
Quote:

> Run this slightly modified version from a *Command Prompt*, then report what
> you see on the screen.
> @echo off
> set Fld=program files\microsoft office
> for /F %%a in (c:\PCs.txt) do echo del /F \\%%a\c$\%Fld%\*.prf
>
>
> "Rich" <richjone@newsgroup> wrote in message
> news:B6E8458A-84D3-4568-B210-121CE51BF360@newsgroup
Quote:

> > the paths look like they would work, but when i remove the echo, it
> > doesn't
> > delete anything. do we have to do something special to get it to work
> > with
> > UNC paths via the command prompt?
> >
> > "Pegasus [MVP]" wrote:
> >
Quote:

> >>
> >> "Rich" <richjone@newsgroup> wrote in message
> >> news:322AD91B-5948-46E5-B7B4-5391559DCB9A@newsgroup
> >> > Also, as i'm finding out by doing some of them manually, some of the
> >> > files
> >> > are set to read-only, others aren't.
> >> >
> >> > "Rich" wrote:
> >> >
> >> >> I have a text file with one computer name per line.
> >> >>
> >> >> What I need to do is on every one of those computers, if there are any
> >> >> files
> >> >> with a .prf extension in
> >> >> c:\program files\microsoft office\
> >> >> I need to delete them.
> >> >>
> >> >> Does anyone have a script that would do this so I don't have to do it
> >> >> manually on hundreds of computers?
> >>
> >> The simplest method would be by batch file:
> >> @echo off
> >> set Fld=program files\microsoft office
> >> for /F %%a in (c:\PCs.txt) do echo del /F \\%%a\c$\%Fld%\*.prf 2>nul
> >>
> >> Remove the word "echo" in the last line to activate the batch file. Add
> >> the
> >> /S switch to the "del" command if you wish to process subdirectories.
> >>
> >>
> >>
>
>
>
My System SpecsSystem Spec
Old 10-02-2009   #10 (permalink)
Pegasus [MVP]


 
 

Re: Delete all *.prf files in a certain directory on multiple comp

The message means exactly what it says: That your path is incorrect. Try to
type the following command from a Command Prompt for at least one of your
machines, then report both the commands and the result.

set Fld=program files\microsoft office
dir \\xxx\c$\%Fld%\*.prf
dir /s \\xxx\c$\%Fld%\*.prf

Replace "xxx" with the valid NetBIOS name of a PC.

By the way, did you realise that the folder "C:\Program Files\Microsoft
Office" never contains any .prf files? If you omit the /s switch then you
would get exactly what you currently see . . .

"Rich" <richjone@newsgroup> wrote in message
news:AE7CD18C-1731-4F1A-86DC-287D1BADD2C3@newsgroup
Quote:

> it echos the right paths just as the previous version did, but now when I
> run
> it without the echo, all i get is
>
> The system cannot find the file specified.
> The system cannot find the file specified.
> The system cannot find the file specified.
> The system cannot find the file specified.
> The system cannot find the file specified.
> The network path was not found.
>
>
>
> "Pegasus [MVP]" wrote:
>
Quote:

>> Run this slightly modified version from a *Command Prompt*, then report
>> what
>> you see on the screen.
>> @echo off
>> set Fld=program files\microsoft office
>> for /F %%a in (c:\PCs.txt) do echo del /F \\%%a\c$\%Fld%\*.prf
>>
>>
>> "Rich" <richjone@newsgroup> wrote in message
>> news:B6E8458A-84D3-4568-B210-121CE51BF360@newsgroup
Quote:

>> > the paths look like they would work, but when i remove the echo, it
>> > doesn't
>> > delete anything. do we have to do something special to get it to work
>> > with
>> > UNC paths via the command prompt?
>> >
>> > "Pegasus [MVP]" wrote:
>> >
>> >>
>> >> "Rich" <richjone@newsgroup> wrote in message
>> >> news:322AD91B-5948-46E5-B7B4-5391559DCB9A@newsgroup
>> >> > Also, as i'm finding out by doing some of them manually, some of the
>> >> > files
>> >> > are set to read-only, others aren't.
>> >> >
>> >> > "Rich" wrote:
>> >> >
>> >> >> I have a text file with one computer name per line.
>> >> >>
>> >> >> What I need to do is on every one of those computers, if there are
>> >> >> any
>> >> >> files
>> >> >> with a .prf extension in
>> >> >> c:\program files\microsoft office\
>> >> >> I need to delete them.
>> >> >>
>> >> >> Does anyone have a script that would do this so I don't have to do
>> >> >> it
>> >> >> manually on hundreds of computers?
>> >>
>> >> The simplest method would be by batch file:
>> >> @echo off
>> >> set Fld=program files\microsoft office
>> >> for /F %%a in (c:\PCs.txt) do echo del /F \\%%a\c$\%Fld%\*.prf 2>nul
>> >>
>> >> Remove the word "echo" in the last line to activate the batch file.
>> >> Add
>> >> the
>> >> /S switch to the "del" command if you wish to process subdirectories.
>> >>
>> >>
>> >>
>>
>>
>>

My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
Delete files on remote computer VB Script
Easy transfer...will it delete files from old computer? Vista installation & setup
Can't select multiple files in my computer Vista file management
WLM Generating Multiple 16MB Log files in storage directory Vista mail
Cannot access C: root directory on Vista computer from XP computer Vista networking & sharing


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46