PDA

View Full Version : Creating a .bat file?


Kate
December 4th 09, 07:13 PM
XP Home SP3
Apologies if this is not the place to ask this question, but I would
like to create a .bat file or something to delete the dozens of temp
files which a program I have leaves in my Temp folder every time I run
it. The files are always named in a particular way so can easily be
identified, I think/hope. I do not want to delete all of the files in
the Temp folder, though. Is this possible, please, and how would I go
about it?

Many thanks
Kate

Leonard Grey[_3_]
December 4th 09, 07:25 PM
Without knowing what program you're talking about, what kind of
temporary files it creates and why, it's impossible to advise you on the
wisdom of deleting these files.

But if you're bound and determined to get rid of them, try the Disk
Cleanup Wizard in Windows, or one of the millions of programs available
for download that do this. (CCleaner is often mentioned here.)
---
Leonard Grey
Errare humanum est

Kate wrote:
> XP Home SP3
> Apologies if this is not the place to ask this question, but I would
> like to create a .bat file or something to delete the dozens of temp
> files which a program I have leaves in my Temp folder every time I run
> it. The files are always named in a particular way so can easily be
> identified, I think/hope. I do not want to delete all of the files in
> the Temp folder, though. Is this possible, please, and how would I go
> about it?
>
> Many thanks
> Kate
>

Kate
December 4th 09, 07:47 PM
Thanks for the reply.
I would like to be able to just click, say, a shortcut after I had run
the program, rather than open another program to "search and destroy".
I might as well open the Temp folder and delete them manually,
otherwise. The files are created by Pace Interlok and are totally
unnecessary to the subsequent running of the program. Indeed, each
time the program is opened, yet another load of files are saved rather
than it using the existing ones and they can multiply to such an
extent that they number in their 100s if I don`t clear up each time.
The program that uses Interlok is DxO Optics, a very good RAW
converter, and it is a pity that they use such intrusive anti-piracy
software.
Thanks again
Kate

"Leonard Grey" > wrote in message
...
> Without knowing what program you're talking about, what kind of
> temporary files it creates and why, it's impossible to advise you on
> the wisdom of deleting these files.
>
> But if you're bound and determined to get rid of them, try the Disk
> Cleanup Wizard in Windows, or one of the millions of programs
> available for download that do this. (CCleaner is often mentioned
> here.)
> ---
> Leonard Grey
> Errare humanum est
>
> Kate wrote:
>> XP Home SP3
>> Apologies if this is not the place to ask this question, but I
>> would
>> like to create a .bat file or something to delete the dozens of
>> temp
>> files which a program I have leaves in my Temp folder every time I
>> run
>> it. The files are always named in a particular way so can easily
>> be
>> identified, I think/hope. I do not want to delete all of the files
>> in
>> the Temp folder, though. Is this possible, please, and how would I
>> go
>> about it?
>>
>> Many thanks
>> Kate
>>

Leonard Grey[_3_]
December 4th 09, 07:56 PM
I clean out temp files (with CCleaner) in two clicks. If you can stomach
one extra click, you don't need to learn about batch files or take the
risk of making a mistake.
---
Leonard Grey
Errare humanum est

Kate wrote:
> Thanks for the reply.
> I would like to be able to just click, say, a shortcut after I had run
> the program, rather than open another program to "search and destroy".
> I might as well open the Temp folder and delete them manually,
> otherwise. The files are created by Pace Interlok and are totally
> unnecessary to the subsequent running of the program. Indeed, each
> time the program is opened, yet another load of files are saved rather
> than it using the existing ones and they can multiply to such an
> extent that they number in their 100s if I don`t clear up each time.
> The program that uses Interlok is DxO Optics, a very good RAW
> converter, and it is a pity that they use such intrusive anti-piracy
> software.
> Thanks again
> Kate
>
> "Leonard Grey" > wrote in message
> ...
>> Without knowing what program you're talking about, what kind of
>> temporary files it creates and why, it's impossible to advise you on
>> the wisdom of deleting these files.
>>
>> But if you're bound and determined to get rid of them, try the Disk
>> Cleanup Wizard in Windows, or one of the millions of programs
>> available for download that do this. (CCleaner is often mentioned
>> here.)
>> ---
>> Leonard Grey
>> Errare humanum est
>>
>> Kate wrote:
>>> XP Home SP3
>>> Apologies if this is not the place to ask this question, but I
>>> would
>>> like to create a .bat file or something to delete the dozens of
>>> temp
>>> files which a program I have leaves in my Temp folder every time I
>>> run
>>> it. The files are always named in a particular way so can easily
>>> be
>>> identified, I think/hope. I do not want to delete all of the files
>>> in
>>> the Temp folder, though. Is this possible, please, and how would I
>>> go
>>> about it?
>>>
>>> Many thanks
>>> Kate
>>>
>

John John - MVP[_2_]
December 4th 09, 08:02 PM
Kate wrote:
> XP Home SP3
> Apologies if this is not the place to ask this question, but I would
> like to create a .bat file or something to delete the dozens of temp
> files which a program I have leaves in my Temp folder every time I run
> it. The files are always named in a particular way so can easily be
> identified, I think/hope. I do not want to delete all of the files in
> the Temp folder, though. Is this possible, please, and how would I go
> about it?

Trying something like this at the command prompt should give you ideas:

for %f in (c:\"Temp Folder Name"\*.tmp) do @echo %f

The above is perfectly safe, it will only echo file names. To delete
files replace the @echo command with del and surround the variable with
quotation marks, the quotation marks are needed if the filenames
contains spaces. At the Command Prompt use single %, in a batch file
double them up:

for %%f in (c:\"Temp Folder Name"\*.tmp) do del "%%f"

Careful!!! files deleted by batch file or at the Command Prompt do not
go to the Recycle Bin!

John

Kate
December 4th 09, 08:10 PM
Does CCleaner clear the entire Temp folder, or can I specify which
files I want deleted, please? Incidentally, I thought that temp files
were just that : temporary, and could be deleted with impunity unless
a program was actually running and using them.

Kate

"Leonard Grey" > wrote in message
...
>I clean out temp files (with CCleaner) in two clicks. If you can
>stomach one extra click, you don't need to learn about batch files or
>take the risk of making a mistake.
> ---
> Leonard Grey
> Errare humanum est
>
> Kate wrote:
>> Thanks for the reply.
>> I would like to be able to just click, say, a shortcut after I had
>> run
>> the program, rather than open another program to "search and
>> destroy".
>> I might as well open the Temp folder and delete them manually,
>> otherwise. The files are created by Pace Interlok and are totally
>> unnecessary to the subsequent running of the program. Indeed, each
>> time the program is opened, yet another load of files are saved
>> rather
>> than it using the existing ones and they can multiply to such an
>> extent that they number in their 100s if I don`t clear up each
>> time.
>> The program that uses Interlok is DxO Optics, a very good RAW
>> converter, and it is a pity that they use such intrusive
>> anti-piracy
>> software.
>> Thanks again
>> Kate
>>
>> "Leonard Grey" > wrote in message
>> ...
>>> Without knowing what program you're talking about, what kind of
>>> temporary files it creates and why, it's impossible to advise you
>>> on
>>> the wisdom of deleting these files.
>>>
>>> But if you're bound and determined to get rid of them, try the
>>> Disk
>>> Cleanup Wizard in Windows, or one of the millions of programs
>>> available for download that do this. (CCleaner is often mentioned
>>> here.)
>>> ---
>>> Leonard Grey
>>> Errare humanum est
>>>
>>> Kate wrote:
>>>> XP Home SP3
>>>> Apologies if this is not the place to ask this question, but I
>>>> would
>>>> like to create a .bat file or something to delete the dozens of
>>>> temp
>>>> files which a program I have leaves in my Temp folder every time
>>>> I
>>>> run
>>>> it. The files are always named in a particular way so can easily
>>>> be
>>>> identified, I think/hope. I do not want to delete all of the
>>>> files
>>>> in
>>>> the Temp folder, though. Is this possible, please, and how would
>>>> I
>>>> go
>>>> about it?
>>>>
>>>> Many thanks
>>>> Kate
>>>>
>>

Bill in Co.
December 4th 09, 08:31 PM
Kate wrote:
> XP Home SP3
> Apologies if this is not the place to ask this question, but I would
> like to create a .bat file or something to delete the dozens of temp
> files which a program I have leaves in my Temp folder every time I run
> it. The files are always named in a particular way so can easily be
> identified, I think/hope. I do not want to delete all of the files in
> the Temp folder, though. Is this possible, please, and how would I go
> about it?
>
> Many thanks
> Kate

The syntax for doing something like that is like this:
del \windows\temp\trb*.tmp
(In this example we'd be referring to the \windows\temp folder).

This would delete all .tmp files in that folder beginning with trb
You simply put that line above into a text file created with Notepad, and
rename that text file with a .bat extension. You could call it
erasetmp.bat.

Ken Blake, MVP
December 4th 09, 08:32 PM
On Fri, 4 Dec 2009 20:10:10 -0000, "Kate" >
wrote:

> Incidentally, I thought that temp files
> were just that : temporary,


Yes, exactly. However, every now and then they get left behind,
usually because the program that created them doesn't close normally.


> and could be deleted with impunity unless
> a program was actually running and using them.


Yes, however you can always delete (at least try to delete) them with
impunity. You won't be permitted to delete one if a running program is
using it.


--
Ken Blake, Microsoft MVP (Windows Desktop Experience) since 2003
Please Reply to the Newsgroup

Leonard Grey[_3_]
December 4th 09, 08:58 PM
Ccleaner cleans the Windows temporary folder and you can specify
additional folders to clean out.

Temporary files cannot be cleaned out 'with impunity'. Sometimes they
hold information a program needs, albeit temporarily.

I'm not making some kind of product endorsement for CCleaner. My point
is, why re-invent the wheel?
---
Leonard Grey
Errare humanum est

Kate wrote:
> Does CCleaner clear the entire Temp folder, or can I specify which
> files I want deleted, please? Incidentally, I thought that temp files
> were just that : temporary, and could be deleted with impunity unless
> a program was actually running and using them.
>
> Kate
>
> "Leonard Grey" > wrote in message
> ...
>> I clean out temp files (with CCleaner) in two clicks. If you can
>> stomach one extra click, you don't need to learn about batch files or
>> take the risk of making a mistake.
>> ---
>> Leonard Grey
>> Errare humanum est
>>
>> Kate wrote:
>>> Thanks for the reply.
>>> I would like to be able to just click, say, a shortcut after I had
>>> run
>>> the program, rather than open another program to "search and
>>> destroy".
>>> I might as well open the Temp folder and delete them manually,
>>> otherwise. The files are created by Pace Interlok and are totally
>>> unnecessary to the subsequent running of the program. Indeed, each
>>> time the program is opened, yet another load of files are saved
>>> rather
>>> than it using the existing ones and they can multiply to such an
>>> extent that they number in their 100s if I don`t clear up each
>>> time.
>>> The program that uses Interlok is DxO Optics, a very good RAW
>>> converter, and it is a pity that they use such intrusive
>>> anti-piracy
>>> software.
>>> Thanks again
>>> Kate
>>>
>>> "Leonard Grey" > wrote in message
>>> ...
>>>> Without knowing what program you're talking about, what kind of
>>>> temporary files it creates and why, it's impossible to advise you
>>>> on
>>>> the wisdom of deleting these files.
>>>>
>>>> But if you're bound and determined to get rid of them, try the
>>>> Disk
>>>> Cleanup Wizard in Windows, or one of the millions of programs
>>>> available for download that do this. (CCleaner is often mentioned
>>>> here.)
>>>> ---
>>>> Leonard Grey
>>>> Errare humanum est
>>>>
>>>> Kate wrote:
>>>>> XP Home SP3
>>>>> Apologies if this is not the place to ask this question, but I
>>>>> would
>>>>> like to create a .bat file or something to delete the dozens of
>>>>> temp
>>>>> files which a program I have leaves in my Temp folder every time
>>>>> I
>>>>> run
>>>>> it. The files are always named in a particular way so can easily
>>>>> be
>>>>> identified, I think/hope. I do not want to delete all of the
>>>>> files
>>>>> in
>>>>> the Temp folder, though. Is this possible, please, and how would
>>>>> I
>>>>> go
>>>>> about it?
>>>>>
>>>>> Many thanks
>>>>> Kate
>>>>>
>>>
>

Kate
December 4th 09, 09:24 PM
"Bill in Co." > wrote in message
...
> Kate wrote:
>> XP Home SP3
>> Apologies if this is not the place to ask this question, but I
>> would
>> like to create a .bat file or something to delete the dozens of
>> temp
>> files which a program I have leaves in my Temp folder every time I
>> run
>> it. The files are always named in a particular way so can easily
>> be
>> identified, I think/hope. I do not want to delete all of the files
>> in
>> the Temp folder, though. Is this possible, please, and how would I
>> go
>> about it?
>>
>> Many thanks
>> Kate
>
> The syntax for doing something like that is like this:
> del \windows\temp\trb*.tmp
> (In this example we'd be referring to the \windows\temp folder).
>
> This would delete all .tmp files in that folder beginning with trb
> You simply put that line above into a text file created with
> Notepad, and rename that text file with a .bat extension. You could
> call it erasetmp.bat.
>
Might this work, do you think?
del\Documents and Settings\(user name)\Local Settings\Temp\PTM***.tmp
del\Documents and Settings\(user name)\Local Settings\Temp\t*****.tmp

The .tmp files always have numbers and/or letters after the PTM or t
so I have used asterisks as wild-cards. Perhaps more importantly, if
it doesn`t work, can an incorrectly executed .bat file cause problems
elsewhere, do you know?

Thanks to everyone who replied
Kate

Bill Sharpe
December 4th 09, 09:43 PM
Kate wrote:

>>
> Might this work, do you think?
> del\Documents and Settings\(user name)\Local Settings\Temp\PTM***.tmp
> del\Documents and Settings\(user name)\Local Settings\Temp\t*****.tmp
>
> The .tmp files always have numbers and/or letters after the PTM or t so
> I have used asterisks as wild-cards. Perhaps more importantly, if it
> doesn`t work, can an incorrectly executed .bat file cause problems
> elsewhere, do you know?
>
> Thanks to everyone who replied
> Kate

These should work, but leave a space after "del". Also, you only need
one asterisk, not multiple asterisks in these commands.

Bill

Ken Blake, MVP
December 4th 09, 09:48 PM
On Fri, 4 Dec 2009 21:24:38 -0000, "Kate" >
wrote:

>
> "Bill in Co." > wrote in message
> ...
> > Kate wrote:
> >> XP Home SP3
> >> Apologies if this is not the place to ask this question, but I
> >> would
> >> like to create a .bat file or something to delete the dozens of
> >> temp
> >> files which a program I have leaves in my Temp folder every time I
> >> run
> >> it. The files are always named in a particular way so can easily
> >> be
> >> identified, I think/hope. I do not want to delete all of the files
> >> in
> >> the Temp folder, though. Is this possible, please, and how would I
> >> go
> >> about it?
> >>
> >> Many thanks
> >> Kate
> >
> > The syntax for doing something like that is like this:
> > del \windows\temp\trb*.tmp
> > (In this example we'd be referring to the \windows\temp folder).
> >
> > This would delete all .tmp files in that folder beginning with trb
> > You simply put that line above into a text file created with
> > Notepad, and rename that text file with a .bat extension. You could
> > call it erasetmp.bat.
> >
> Might this work, do you think?
> del\Documents and Settings\(user name)\Local Settings\Temp\PTM***.tmp
> del\Documents and Settings\(user name)\Local Settings\Temp\t*****.tmp


Note that there needs to be a space after the del.


> The .tmp files always have numbers and/or letters after the PTM or t
> so I have used asterisks as wild-cards. Perhaps more importantly, if
> it doesn`t work, can an incorrectly executed .bat file cause problems
> elsewhere, do you know?


An asterisk means some number of characters and you can't use multiple
asterisks that way. Use a question mark as wildcard for a single
character.

But why do you want to specify what files you want to delete? Just
delete all the files in the temp folder. Personally I think the
easiest way to do that is to go to the temp folder in Windows
Explorer, sort all the files by date with the oldest on top, select
them all with Ctrl-A, then press the delete key to delete them all. It
will delete everything until it gets to the newest ones that are still
being used.

--
Ken Blake, Microsoft MVP (Windows Desktop Experience) since 2003
Please Reply to the Newsgroup

Bill in Co.
December 4th 09, 10:10 PM
Ken Blake, MVP wrote:
> On Fri, 4 Dec 2009 21:24:38 -0000, "Kate" >
> wrote:
>
>>
>> "Bill in Co." > wrote in message
>> ...
>>> Kate wrote:
>>>> XP Home SP3
>>>> Apologies if this is not the place to ask this question, but I would
>>>> like to create a .bat file or something to delete the dozens of temp
>>>> files which a program I have leaves in my Temp folder every time I
>>>> run
>>>> it. The files are always named in a particular way so can easily be
>>>> identified, I think/hope. I do not want to delete all of the files in
>>>> the Temp folder, though. Is this possible, please, and how would I
>>>> go about it?
>>>>
>>>> Many thanks
>>>> Kate
>>>
>>> The syntax for doing something like that is like this:
>>> del \windows\temp\trb*.tmp
>>> (In this example we'd be referring to the \windows\temp folder).
>>>
>>> This would delete all .tmp files in that folder beginning with trb
>>> You simply put that line above into a text file created with
>>> Notepad, and rename that text file with a .bat extension. You could
>>> call it erasetmp.bat.
>>>
>> Might this work, do you think?
>> del\Documents and Settings\(user name)\Local Settings\Temp\PTM***.tmp
>> del\Documents and Settings\(user name)\Local Settings\Temp\t*****.tmp
>
>
> Note that there needs to be a space after the del.
>
>
>> The .tmp files always have numbers and/or letters after the PTM or t
>> so I have used asterisks as wild-cards. Perhaps more importantly, if
>> it doesn`t work, can an incorrectly executed .bat file cause problems
>> elsewhere, do you know?
>
>
> An asterisk means some number of characters and you can't use multiple
> asterisks that way. Use a question mark as wildcard for a single
> character.
>
> But why do you want to specify what files you want to delete? Just
> delete all the files in the temp folder.

I wouldn't do that, for a couple of reasons. One is for the history
(sometimes I'm chasing down some bugs or mods, and it's helpful to see what
was left or created in there), and the other reason is that sometimes some
temp files are there as part of a program install or uninstall (although
they might be locked, in which case it's not an issue, admitedly). So my
feeling is, why not just delete the undesired ones, and perhaps even know or
be able to determine what app is creating them in the process.

> Personally I think the
> easiest way to do that is to go to the temp folder in Windows
> Explorer, sort all the files by date with the oldest on top, select
> them all with Ctrl-A, then press the delete key to delete them all. It
> will delete everything until it gets to the newest ones that are still
> being used.
>
> --
> Ken Blake, Microsoft MVP (Windows Desktop Experience) since 2003
> Please Reply to the Newsgroup

Bill in Co.
December 4th 09, 10:20 PM
Kate wrote:
> "Bill in Co." > wrote in message
> ...
>> Kate wrote:
>>> XP Home SP3
>>> Apologies if this is not the place to ask this question, but I would
>>> like to create a .bat file or something to delete the dozens of temp
>>> files which a program I have leaves in my Temp folder every time I
>>> run it. The files are always named in a particular way so can easily
>>> be identified, I think/hope. I do not want to delete all of the files
>>> in
>>> the Temp folder, though. Is this possible, please, and how would I
>>> go about it?
>>>
>>> Many thanks
>>> Kate
>>
>> The syntax for doing something like that is like this:
>> del \windows\temp\trb*.tmp
>> (In this example we'd be referring to the \windows\temp folder).
>>
>> This would delete all .tmp files in that folder beginning with trb
>> You simply put that line above into a text file created with
>> Notepad, and rename that text file with a .bat extension. You could
>> call it erasetmp.bat.
>>
> Might this work, do you think?
> del\Documents and Settings\(user name)\Local Settings\Temp\PTM***.tmp
> del\Documents and Settings\(user name)\Local Settings\Temp\t*****.tmp

As already mentioned, you need to add a space after del command.
Also, make it t*.tmp in the batch file (just one asterisk is allowed).
An alternate command would be t?????.tmp, but that's not needed here, but
that would specifically ONLY delete filenames (with t, followed by 5
alphanumeric prefixes). The * is more global: t*.tmp will delete any
filename ending in .tmp that starts with the letter t.

> The .tmp files always have numbers and/or letters after the PTM or t
> so I have used asterisks as wild-cards. Perhaps more importantly, if
> it doesn`t work, can an incorrectly executed .bat file cause problems
> elsewhere, do you know?

Well, if you really messed it up, you could delete some other files you
hadn't intended if they matched the conditions specified in the batch file,
which seems unlikely.

Kate
December 5th 09, 12:07 AM
"Bill in Co." > wrote in message
...
> Kate wrote:
>> "Bill in Co." > wrote in message
>> ...
>>> Kate wrote:
>>>> XP Home SP3
>>>> Apologies if this is not the place to ask this question, but I
>>>> would like to create a .bat file or something to delete the
>>>> dozens of temp files which a program I have leaves in my Temp
>>>> folder every time
>>>> I run it. The files are always named in a particular way so can
>>>> easily be identified, I think/hope. I do not want to delete all
>>>> of the files in the Temp folder, though. Is this possible,
>>>> please, and how would I go about it?
>>>>
>>>> Many thanks
>>>> Kate
>>>
>>> The syntax for doing something like that is like this:
>>> del \windows\temp\trb*.tmp
>>> (In this example we'd be referring to the \windows\temp folder).
>>>
>>> This would delete all .tmp files in that folder beginning with trb
>>> You simply put that line above into a text file created with
>>> Notepad, and rename that text file with a .bat extension. You
>>> could call it erasetmp.bat.
>>>
>> Might this work, do you think?
>> del\Documents and Settings\(user name)\Local
>> Settings\Temp\PTM***.tmp
>> del\Documents and Settings\(user name)\Local
>> Settings\Temp\t*****.tmp
>
> As already mentioned, you need to add a space after del command.
> Also, make it t*.tmp in the batch file (just one asterisk is
> allowed).
> An alternate command would be t?????.tmp, but that's not needed
> here, but that would specifically ONLY delete filenames (with t,
> followed by 5 alphanumeric prefixes). The * is more global:
> t*.tmp will delete any filename ending in .tmp that starts with the
> letter t.

Does that mean the * can be letters and/or numbers, and is a .bat file
case-sensitive? I have some TWAIN and Twunk files in my Temp folder
and although it doesn`t really matter if they are deleted as they are
re-created when I next use my scanner, it would be more...elegant...
if the instructions could be targetted at just the Interlok files.

>
>> The .tmp files always have numbers and/or letters after the PTM or
>> t so I have used asterisks as wild-cards. Perhaps more
>> importantly, if it doesn`t work, can an incorrectly executed .bat
>> file cause problems elsewhere, do you know?
>
> Well, if you really messed it up, you could delete some other files
> you hadn't intended if they matched the conditions specified in the
> batch file, which seems unlikely.
>

I know these files are useless after the program is closed as I have
been manually deleting them without ill-effects after each closure.
Most of the other files in my Local Settings/Temp folder are things
which just get re-created if I do delete them (see above), so I tend
to leave them alone. I think I will give the .bat file a try and see
how it goes. I suspect that if it works well, there will be quite a
few DxO Optics users celebrating, as it isn`t just me that finds these
Interlok files a PITA.

Thanks again to all.
Kate

Kate
December 5th 09, 12:42 AM
"Kate" > wrote in message
...
>
> "Bill in Co." > wrote in message
> ...
>> Kate wrote:
>>> "Bill in Co." > wrote in message
>>> ...
>>>> Kate wrote:
>>>>> XP Home SP3
>>>>> Apologies if this is not the place to ask this question, but I
>>>>> would like to create a .bat file or something to delete the
>>>>> dozens of temp files which a program I have leaves in my Temp
>>>>> folder every time
>>>>> I run it. The files are always named in a particular way so can
>>>>> easily be identified, I think/hope. I do not want to delete all
>>>>> of the files in the Temp folder, though. Is this possible,
>>>>> please, and how would I go about it?
>>>>>
>>>>> Many thanks
>>>>> Kate
>>>>
>>>> The syntax for doing something like that is like this:
>>>> del \windows\temp\trb*.tmp
>>>> (In this example we'd be referring to the \windows\temp folder).
>>>>
>>>> This would delete all .tmp files in that folder beginning with
>>>> trb
>>>> You simply put that line above into a text file created with
>>>> Notepad, and rename that text file with a .bat extension. You
>>>> could call it erasetmp.bat.
>>>>
>>> Might this work, do you think?
>>> del\Documents and Settings\(user name)\Local
>>> Settings\Temp\PTM***.tmp
>>> del\Documents and Settings\(user name)\Local
>>> Settings\Temp\t*****.tmp
>>
>> As already mentioned, you need to add a space after del command.
>> Also, make it t*.tmp in the batch file (just one asterisk is
>> allowed).
>> An alternate command would be t?????.tmp, but that's not needed
>> here, but that would specifically ONLY delete filenames (with t,
>> followed by 5 alphanumeric prefixes). The * is more global:
>> t*.tmp will delete any filename ending in .tmp that starts with the
>> letter t.
>
> Does that mean the * can be letters and/or numbers, and is a .bat
> file
> case-sensitive? I have some TWAIN and Twunk files in my Temp folder
> and although it doesn`t really matter if they are deleted as they
> are
> re-created when I next use my scanner, it would be more...elegant...
> if the instructions could be targetted at just the Interlok files.
>
>>
>>> The .tmp files always have numbers and/or letters after the PTM or
>>> t so I have used asterisks as wild-cards. Perhaps more
>>> importantly, if it doesn`t work, can an incorrectly executed .bat
>>> file cause problems elsewhere, do you know?
>>
>> Well, if you really messed it up, you could delete some other files
>> you hadn't intended if they matched the conditions specified in the
>> batch file, which seems unlikely.
>>
>
> I know these files are useless after the program is closed as I have
> been manually deleting them without ill-effects after each closure.
> Most of the other files in my Local Settings/Temp folder are things
> which just get re-created if I do delete them (see above), so I tend
> to leave them alone. I think I will give the .bat file a try and
> see
> how it goes. I suspect that if it works well, there will be quite a
> few DxO Optics users celebrating, as it isn`t just me that finds
> these
> Interlok files a PITA.
>
> Thanks again to all.
> Kate
>

It didn`t work. In fact, nothing beginning with a P or t (or even a p
or a T!) is being deleted, although I have checked the wording most
carefully and it all seems to be correct. Oh well, it looks like I
shall have to manually delete them after all. Disappointing.

Kate

Bill in Co.
December 5th 09, 12:52 AM
Kate wrote:
> "Bill in Co." > wrote in message
> ...
>> Kate wrote:
>>> "Bill in Co." > wrote in message
>>> ...
>>>> Kate wrote:
>>>>> XP Home SP3
>>>>> Apologies if this is not the place to ask this question, but I
>>>>> would like to create a .bat file or something to delete the
>>>>> dozens of temp files which a program I have leaves in my Temp
>>>>> folder every time
>>>>> I run it. The files are always named in a particular way so can
>>>>> easily be identified, I think/hope. I do not want to delete all
>>>>> of the files in the Temp folder, though. Is this possible,
>>>>> please, and how would I go about it?
>>>>>
>>>>> Many thanks
>>>>> Kate
>>>>
>>>> The syntax for doing something like that is like this:
>>>> del \windows\temp\trb*.tmp
>>>> (In this example we'd be referring to the \windows\temp folder).
>>>>
>>>> This would delete all .tmp files in that folder beginning with trb
>>>> You simply put that line above into a text file created with
>>>> Notepad, and rename that text file with a .bat extension. You
>>>> could call it erasetmp.bat.
>>>>
>>> Might this work, do you think?
>>> del\Documents and Settings\(user name)\Local
>>> Settings\Temp\PTM***.tmp
>>> del\Documents and Settings\(user name)\Local
>>> Settings\Temp\t*****.tmp
>>
>> As already mentioned, you need to add a space after del command.
>> Also, make it t*.tmp in the batch file (just one asterisk is allowed).
>> An alternate command would be t?????.tmp, but that's not needed
>> here, but that would specifically ONLY delete filenames (with t,
>> followed by 5 alphanumeric prefixes). The * is more global:
>> t*.tmp will delete any filename ending in .tmp that starts with the
>> letter t.
>
> Does that mean the * can be letters and/or numbers,

* covers letters or numbers (any alpha-numeric characters) - it's a generic
global parameter.

> and is a .bat file case-sensitive?

No.

> I have some TWAIN and Twunk files in my Temp folder
> and although it doesn`t really matter if they are deleted as they are
> re-created when I next use my scanner, it would be more...elegant...
> if the instructions could be targetted at just the Interlok files.
>
>>
>>> The .tmp files always have numbers and/or letters after the PTM or
>>> t so I have used asterisks as wild-cards. Perhaps more
>>> importantly, if it doesn`t work, can an incorrectly executed .bat
>>> file cause problems elsewhere, do you know?
>>
>> Well, if you really messed it up, you could delete some other files
>> you hadn't intended if they matched the conditions specified in the
>> batch file, which seems unlikely.
>>
>
> I know these files are useless after the program is closed as I have
> been manually deleting them without ill-effects after each closure.
> Most of the other files in my Local Settings/Temp folder are things
> which just get re-created if I do delete them (see above), so I tend
> to leave them alone. I think I will give the .bat file a try and see
> how it goes. I suspect that if it works well, there will be quite a
> few DxO Optics users celebrating, as it isn`t just me that finds these
> Interlok files a PITA.
>
> Thanks again to all.
> Kate

Bill in Co.
December 5th 09, 12:58 AM
Kate wrote:
> "Kate" > wrote in message
> ...
>>
>> "Bill in Co." > wrote in message
>> ...
>>> Kate wrote:
>>>> "Bill in Co." > wrote in message
>>>> ...
>>>>> Kate wrote:
>>>>>> XP Home SP3
>>>>>> Apologies if this is not the place to ask this question, but I
>>>>>> would like to create a .bat file or something to delete the
>>>>>> dozens of temp files which a program I have leaves in my Temp
>>>>>> folder every time
>>>>>> I run it. The files are always named in a particular way so can
>>>>>> easily be identified, I think/hope. I do not want to delete all
>>>>>> of the files in the Temp folder, though. Is this possible,
>>>>>> please, and how would I go about it?
>>>>>>
>>>>>> Many thanks
>>>>>> Kate
>>>>>
>>>>> The syntax for doing something like that is like this:
>>>>> del \windows\temp\trb*.tmp
>>>>> (In this example we'd be referring to the \windows\temp folder).
>>>>>
>>>>> This would delete all .tmp files in that folder beginning with
>>>>> trb
>>>>> You simply put that line above into a text file created with
>>>>> Notepad, and rename that text file with a .bat extension. You
>>>>> could call it erasetmp.bat.
>>>>>
>>>> Might this work, do you think?
>>>> del\Documents and Settings\(user name)\Local
>>>> Settings\Temp\PTM***.tmp
>>>> del\Documents and Settings\(user name)\Local
>>>> Settings\Temp\t*****.tmp
>>>
>>> As already mentioned, you need to add a space after del command.
>>> Also, make it t*.tmp in the batch file (just one asterisk is
>>> allowed).
>>> An alternate command would be t?????.tmp, but that's not needed
>>> here, but that would specifically ONLY delete filenames (with t,
>>> followed by 5 alphanumeric prefixes). The * is more global:
>>> t*.tmp will delete any filename ending in .tmp that starts with the
>>> letter t.
>>
>> Does that mean the * can be letters and/or numbers,

Yes (as mentioned - it's a global substitute)

>> and is a .bat file case-sensitive?

No.

I have some TWAIN and Twunk files in my Temp folder
>> and although it doesn`t really matter if they are deleted as they
>> are
>> re-created when I next use my scanner, it would be more...elegant...
>> if the instructions could be targetted at just the Interlok files.
>>
>>>
>>>> The .tmp files always have numbers and/or letters after the PTM or
>>>> t so I have used asterisks as wild-cards. Perhaps more
>>>> importantly, if it doesn`t work, can an incorrectly executed .bat
>>>> file cause problems elsewhere, do you know?
>>>
>>> Well, if you really messed it up, you could delete some other files
>>> you hadn't intended if they matched the conditions specified in the
>>> batch file, which seems unlikely.
>>>
>>
>> I know these files are useless after the program is closed as I have
>> been manually deleting them without ill-effects after each closure.
>> Most of the other files in my Local Settings/Temp folder are things
>> which just get re-created if I do delete them (see above), so I tend
>> to leave them alone. I think I will give the .bat file a try and see
>> how it goes. I suspect that if it works well, there will be quite a
>> few DxO Optics users celebrating, as it isn`t just me that finds
>> these Interlok files a PITA.
>>
>> Thanks again to all.
>> Kate
>>
>
> It didn`t work. In fact, nothing beginning with a P or t (or even a p
> or a T!) is being deleted, although I have checked the wording most
> carefully and it all seems to be correct. Oh well, it looks like I
> shall have to manually delete them after all. Disappointing.
>
> Kate

I'm not sure exactly what the contents of your "erasetmp.bat" file looks
like. Maybe you can copy and paste it into here. The punctuation is
critical, of course. I assume you created a pure text file in *Notepad*.
Don't use a word processor for this - it needs to be a pure text file.

Here again is a simple one:

del c:\windows\*.tmp (note: space only after the del command)

would delete all .tmp files in that directory (after just double clicking on
the "erasetmp.bat" file it's written in).

John John - MVP[_2_]
December 5th 09, 03:58 PM
Kate wrote:
>
> "Kate" > wrote in message
> ...
>>
>> "Bill in Co." > wrote in message
>> ...
>>> Kate wrote:
>>>> "Bill in Co." > wrote in message
>>>> ...
>>>>> Kate wrote:
>>>>>> XP Home SP3
>>>>>> Apologies if this is not the place to ask this question, but I
>>>>>> would like to create a .bat file or something to delete the dozens
>>>>>> of temp files which a program I have leaves in my Temp folder
>>>>>> every time
>>>>>> I run it. The files are always named in a particular way so can
>>>>>> easily be identified, I think/hope. I do not want to delete all
>>>>>> of the files in the Temp folder, though. Is this possible,
>>>>>> please, and how would I go about it?
>>>>>>
>>>>>> Many thanks
>>>>>> Kate
>>>>>
>>>>> The syntax for doing something like that is like this:
>>>>> del \windows\temp\trb*.tmp
>>>>> (In this example we'd be referring to the \windows\temp folder).
>>>>>
>>>>> This would delete all .tmp files in that folder beginning with trb
>>>>> You simply put that line above into a text file created with
>>>>> Notepad, and rename that text file with a .bat extension. You
>>>>> could call it erasetmp.bat.
>>>>>
>>>> Might this work, do you think?
>>>> del\Documents and Settings\(user name)\Local Settings\Temp\PTM***.tmp
>>>> del\Documents and Settings\(user name)\Local Settings\Temp\t*****.tmp
>>>
>>> As already mentioned, you need to add a space after del command.
>>> Also, make it t*.tmp in the batch file (just one asterisk is
>>> allowed).
>>> An alternate command would be t?????.tmp, but that's not needed
>>> here, but that would specifically ONLY delete filenames (with t,
>>> followed by 5 alphanumeric prefixes). The * is more global:
>>> t*.tmp will delete any filename ending in .tmp that starts with the
>>> letter t.
>>
>> Does that mean the * can be letters and/or numbers, and is a .bat file
>> case-sensitive? I have some TWAIN and Twunk files in my Temp folder
>> and although it doesn`t really matter if they are deleted as they are
>> re-created when I next use my scanner, it would be more...elegant...
>> if the instructions could be targetted at just the Interlok files.
>>
>>>
>>>> The .tmp files always have numbers and/or letters after the PTM or
>>>> t so I have used asterisks as wild-cards. Perhaps more
>>>> importantly, if it doesn`t work, can an incorrectly executed .bat
>>>> file cause problems elsewhere, do you know?
>>>
>>> Well, if you really messed it up, you could delete some other files
>>> you hadn't intended if they matched the conditions specified in the
>>> batch file, which seems unlikely.
>>>
>>
>> I know these files are useless after the program is closed as I have
>> been manually deleting them without ill-effects after each closure.
>> Most of the other files in my Local Settings/Temp folder are things
>> which just get re-created if I do delete them (see above), so I tend
>> to leave them alone. I think I will give the .bat file a try and see
>> how it goes. I suspect that if it works well, there will be quite a
>> few DxO Optics users celebrating, as it isn`t just me that finds these
>> Interlok files a PITA.
>>
>> Thanks again to all.
>> Kate
>>
>
> It didn`t work. In fact, nothing beginning with a P or t (or even a p
> or a T!) is being deleted, although I have checked the wording most
> carefully and it all seems to be correct. Oh well, it looks like I
> shall have to manually delete them after all. Disappointing.

It should work, I think that you're doing something wrong. Experiment
with it at the Command Prompt using the DIR command and see what the
command returns:

dir /b c:\"folder name\p*.tmp"

If the DIR command returns a proper list of files that you want to
delete then then there is no reason why the DEL command shouldn't delete
them. Remember that if there are spaces in the path or file names that
you *must* encapsulate the path with "quotation marks" (as above) or
else the command will fail.

John

Kate
December 5th 09, 05:33 PM
"John John - MVP" > wrote in message
...
> Kate wrote:
>>
>> "Kate" > wrote in message
>> ...
>>>
>>> "Bill in Co." > wrote in message
>>> ...
>>>> Kate wrote:
>>>>> "Bill in Co." > wrote in message
>>>>> ...
>>>>>> Kate wrote:
>>>>>>> XP Home SP3
>>>>>>> Apologies if this is not the place to ask this question, but I
>>>>>>> would like to create a .bat file or something to delete the
>>>>>>> dozens of temp files which a program I have leaves in my Temp
>>>>>>> folder every time
>>>>>>> I run it. The files are always named in a particular way so
>>>>>>> can easily be identified, I think/hope. I do not want to
>>>>>>> delete all of the files in the Temp folder, though. Is this
>>>>>>> possible, please, and how would I go about it?
>>>>>>>
>>>>>>> Many thanks
>>>>>>> Kate
>>>>>>
>>>>>> The syntax for doing something like that is like this:
>>>>>> del \windows\temp\trb*.tmp
>>>>>> (In this example we'd be referring to the \windows\temp
>>>>>> folder).
>>>>>>
>>>>>> This would delete all .tmp files in that folder beginning with
>>>>>> trb
>>>>>> You simply put that line above into a text file created with
>>>>>> Notepad, and rename that text file with a .bat extension. You
>>>>>> could call it erasetmp.bat.
>>>>>>
>>>>> Might this work, do you think?
>>>>> del\Documents and Settings\(user name)\Local
>>>>> Settings\Temp\PTM***.tmp
>>>>> del\Documents and Settings\(user name)\Local
>>>>> Settings\Temp\t*****.tmp
>>>>
>>>> As already mentioned, you need to add a space after del command.
>>>> Also, make it t*.tmp in the batch file (just one asterisk is
>>>> allowed).
>>>> An alternate command would be t?????.tmp, but that's not needed
>>>> here, but that would specifically ONLY delete filenames (with t,
>>>> followed by 5 alphanumeric prefixes). The * is more global:
>>>> t*.tmp will delete any filename ending in .tmp that starts with
>>>> the letter t.
>>>
>>> Does that mean the * can be letters and/or numbers, and is a .bat
>>> file case-sensitive? I have some TWAIN and Twunk files in my Temp
>>> folder and although it doesn`t really matter if they are deleted
>>> as they
>>> are re-created when I next use my scanner, it would be
>>> more...elegant... if the instructions could be targetted at just
>>> the Interlok files.
>>>
>>>>
>>>>> The .tmp files always have numbers and/or letters after the PTM
>>>>> or t so I have used asterisks as wild-cards. Perhaps more
>>>>> importantly, if it doesn`t work, can an incorrectly executed
>>>>> .bat file cause problems elsewhere, do you know?
>>>>
>>>> Well, if you really messed it up, you could delete some other
>>>> files you hadn't intended if they matched the conditions
>>>> specified in
>>>> the batch file, which seems unlikely.
>>>>
>>>
>>> I know these files are useless after the program is closed as I
>>> have been manually deleting them without ill-effects after each
>>> closure. Most of the other files in my Local Settings/Temp folder
>>> are
>>> things which just get re-created if I do delete them (see above),
>>> so I
>>> tend to leave them alone. I think I will give the .bat file a try
>>> and
>>> see how it goes. I suspect that if it works well, there will be
>>> quite
>>> a few DxO Optics users celebrating, as it isn`t just me that finds
>>> these Interlok files a PITA.
>>>
>>> Thanks again to all.
>>> Kate
>>>
>>
>> It didn`t work. In fact, nothing beginning with a P or t (or even
>> a p or a T!) is being deleted, although I have checked the wording
>> most carefully and it all seems to be correct. Oh well, it looks
>> like I shall have to manually delete them after all. Disappointing.
>
> It should work, I think that you're doing something wrong.
> Experiment with it at the Command Prompt using the DIR command and
> see what the command returns:
>
> dir /b c:\"folder name\p*.tmp"
>
> If the DIR command returns a proper list of files that you want to
> delete then then there is no reason why the DEL command shouldn't
> delete them. Remember that if there are spaces in the path or file
> names that you *must* encapsulate the path with "quotation marks"
> (as above) or else the command will fail.
>
> John

The command prompt worked correctly, so I must be doing something
wrong creating the .bat. In Notepad, I wrote
del \F:\Documents and Settings\(user name)\Local Settings\Temp\p*.tmp
del \F:\Documents and Settings\(user name)\Local Settings\Temp\t*.tmp

(F: is my main drive, BTW, as you probably guessed and I am copying
the path exactly as it appears in the address bar of my Temp folder)

I have tried it with and without F:, with quotation marks and without
(grasping at straws there), but it still doesn`t work. I also tried
replacing the * with ????, targetting specific files, but to no avail.
Then I thought that maybe these Interlok files are locked in some way,
so I tried naming a specific log file which has nothing to do with
Interlok, but that didn`t erase either. I cannot see where I am going
wrong!

Thanks
Kate

John John - MVP[_2_]
December 5th 09, 06:23 PM
Kate wrote:
>
> "John John - MVP" > wrote in message
> ...
>> Kate wrote:
>>>
>>> "Kate" > wrote in message
>>> ...
>>>>
>>>> "Bill in Co." > wrote in message
>>>> ...
>>>>> Kate wrote:
>>>>>> "Bill in Co." > wrote in message
>>>>>> ...
>>>>>>> Kate wrote:
>>>>>>>> XP Home SP3
>>>>>>>> Apologies if this is not the place to ask this question, but I
>>>>>>>> would like to create a .bat file or something to delete the
>>>>>>>> dozens of temp files which a program I have leaves in my Temp
>>>>>>>> folder every time
>>>>>>>> I run it. The files are always named in a particular way so
>>>>>>>> can easily be identified, I think/hope. I do not want to
>>>>>>>> delete all of the files in the Temp folder, though. Is this
>>>>>>>> possible, please, and how would I go about it?
>>>>>>>>
>>>>>>>> Many thanks
>>>>>>>> Kate
>>>>>>>
>>>>>>> The syntax for doing something like that is like this:
>>>>>>> del \windows\temp\trb*.tmp
>>>>>>> (In this example we'd be referring to the \windows\temp
>>>>>>> folder).
>>>>>>>
>>>>>>> This would delete all .tmp files in that folder beginning with
>>>>>>> trb
>>>>>>> You simply put that line above into a text file created with
>>>>>>> Notepad, and rename that text file with a .bat extension. You
>>>>>>> could call it erasetmp.bat.
>>>>>>>
>>>>>> Might this work, do you think?
>>>>>> del\Documents and Settings\(user name)\Local
>>>>>> Settings\Temp\PTM***.tmp
>>>>>> del\Documents and Settings\(user name)\Local
>>>>>> Settings\Temp\t*****.tmp
>>>>>
>>>>> As already mentioned, you need to add a space after del command.
>>>>> Also, make it t*.tmp in the batch file (just one asterisk is
>>>>> allowed).
>>>>> An alternate command would be t?????.tmp, but that's not needed
>>>>> here, but that would specifically ONLY delete filenames (with t,
>>>>> followed by 5 alphanumeric prefixes). The * is more global:
>>>>> t*.tmp will delete any filename ending in .tmp that starts with
>>>>> the letter t.
>>>>
>>>> Does that mean the * can be letters and/or numbers, and is a .bat
>>>> file case-sensitive? I have some TWAIN and Twunk files in my Temp
>>>> folder and although it doesn`t really matter if they are deleted
>>>> as they
>>>> are re-created when I next use my scanner, it would be
>>>> more...elegant... if the instructions could be targetted at just
>>>> the Interlok files.
>>>>
>>>>>
>>>>>> The .tmp files always have numbers and/or letters after the PTM
>>>>>> or t so I have used asterisks as wild-cards. Perhaps more
>>>>>> importantly, if it doesn`t work, can an incorrectly executed
>>>>>> .bat file cause problems elsewhere, do you know?
>>>>>
>>>>> Well, if you really messed it up, you could delete some other
>>>>> files you hadn't intended if they matched the conditions
>>>>> specified in
>>>>> the batch file, which seems unlikely.
>>>>>
>>>>
>>>> I know these files are useless after the program is closed as I
>>>> have been manually deleting them without ill-effects after each
>>>> closure. Most of the other files in my Local Settings/Temp folder
>>>> are
>>>> things which just get re-created if I do delete them (see above),
>>>> so I
>>>> tend to leave them alone. I think I will give the .bat file a try
>>>> and
>>>> see how it goes. I suspect that if it works well, there will be
>>>> quite
>>>> a few DxO Optics users celebrating, as it isn`t just me that finds
>>>> these Interlok files a PITA.
>>>>
>>>> Thanks again to all.
>>>> Kate
>>>>
>>>
>>> It didn`t work. In fact, nothing beginning with a P or t (or even
>>> a p or a T!) is being deleted, although I have checked the wording
>>> most carefully and it all seems to be correct. Oh well, it looks
>>> like I shall have to manually delete them after all. Disappointing.
>>
>> It should work, I think that you're doing something wrong.
>> Experiment with it at the Command Prompt using the DIR command and
>> see what the command returns:
>>
>> dir /b c:\"folder name\p*.tmp"
>>
>> If the DIR command returns a proper list of files that you want to
>> delete then then there is no reason why the DEL command shouldn't
>> delete them. Remember that if there are spaces in the path or file
>> names that you *must* encapsulate the path with "quotation marks"
>> (as above) or else the command will fail.
>>
>> John
>
> The command prompt worked correctly, so I must be doing something
> wrong creating the .bat. In Notepad, I wrote
> del \F:\Documents and Settings\(user name)\Local Settings\Temp\p*.tmp
> del \F:\Documents and Settings\(user name)\Local Settings\Temp\t*.tmp

Don't use the first forward slash in the path and use the quotation
marks, try it *exactly* like this:

del "F:\Documents and Settings\(user name)\Local Settings\Temp\p*.tmp"
del "F:\Documents and Settings\(user name)\Local Settings\Temp\t*.tmp"

John

Kate
December 5th 09, 06:44 PM
"John John - MVP" > wrote in message
...
> Kate wrote:
>>
>> "John John - MVP" > wrote in message
>> ...
>>> Kate wrote:
>>>>
>>>> "Kate" > wrote in message
>>>> ...
>>>>>
>>>>> "Bill in Co." > wrote in message
>>>>> ...
>>>>>> Kate wrote:
>>>>>>> "Bill in Co." > wrote in message
>>>>>>> ...
>>>>>>>> Kate wrote:
>>>>>>>>> XP Home SP3
>>>>>>>>> Apologies if this is not the place to ask this question, but
>>>>>>>>> I
>>>>>>>>> would like to create a .bat file or something to delete the
>>>>>>>>> dozens of temp files which a program I have leaves in my
>>>>>>>>> Temp
>>>>>>>>> folder every time
>>>>>>>>> I run it. The files are always named in a particular way so
>>>>>>>>> can easily be identified, I think/hope. I do not want to
>>>>>>>>> delete all of the files in the Temp folder, though. Is this
>>>>>>>>> possible, please, and how would I go about it?
>>>>>>>>>
>>>>>>>>> Many thanks
>>>>>>>>> Kate
>>>>>>>>
>>>>>>>> The syntax for doing something like that is like this:
>>>>>>>> del \windows\temp\trb*.tmp
>>>>>>>> (In this example we'd be referring to the \windows\temp
>>>>>>>> folder).
>>>>>>>>
>>>>>>>> This would delete all .tmp files in that folder beginning
>>>>>>>> with
>>>>>>>> trb
>>>>>>>> You simply put that line above into a text file created with
>>>>>>>> Notepad, and rename that text file with a .bat extension.
>>>>>>>> You
>>>>>>>> could call it erasetmp.bat.
>>>>>>>>
>>>>>>> Might this work, do you think?
>>>>>>> del\Documents and Settings\(user name)\Local
>>>>>>> Settings\Temp\PTM***.tmp
>>>>>>> del\Documents and Settings\(user name)\Local
>>>>>>> Settings\Temp\t*****.tmp
>>>>>>
>>>>>> As already mentioned, you need to add a space after del
>>>>>> command.
>>>>>> Also, make it t*.tmp in the batch file (just one asterisk is
>>>>>> allowed).
>>>>>> An alternate command would be t?????.tmp, but that's not
>>>>>> needed
>>>>>> here, but that would specifically ONLY delete filenames (with
>>>>>> t,
>>>>>> followed by 5 alphanumeric prefixes). The * is more global:
>>>>>> t*.tmp will delete any filename ending in .tmp that starts with
>>>>>> the letter t.
>>>>>
>>>>> Does that mean the * can be letters and/or numbers, and is a
>>>>> .bat
>>>>> file case-sensitive? I have some TWAIN and Twunk files in my
>>>>> Temp
>>>>> folder and although it doesn`t really matter if they are deleted
>>>>> as they
>>>>> are re-created when I next use my scanner, it would be
>>>>> more...elegant... if the instructions could be targetted at just
>>>>> the Interlok files.
>>>>>
>>>>>>
>>>>>>> The .tmp files always have numbers and/or letters after the
>>>>>>> PTM
>>>>>>> or t so I have used asterisks as wild-cards. Perhaps more
>>>>>>> importantly, if it doesn`t work, can an incorrectly executed
>>>>>>> .bat file cause problems elsewhere, do you know?
>>>>>>
>>>>>> Well, if you really messed it up, you could delete some other
>>>>>> files you hadn't intended if they matched the conditions
>>>>>> specified in
>>>>>> the batch file, which seems unlikely.
>>>>>>
>>>>>
>>>>> I know these files are useless after the program is closed as I
>>>>> have been manually deleting them without ill-effects after each
>>>>> closure. Most of the other files in my Local Settings/Temp
>>>>> folder
>>>>> are
>>>>> things which just get re-created if I do delete them (see
>>>>> above),
>>>>> so I
>>>>> tend to leave them alone. I think I will give the .bat file a
>>>>> try
>>>>> and
>>>>> see how it goes. I suspect that if it works well, there will be
>>>>> quite
>>>>> a few DxO Optics users celebrating, as it isn`t just me that
>>>>> finds
>>>>> these Interlok files a PITA.
>>>>>
>>>>> Thanks again to all.
>>>>> Kate
>>>>>
>>>>
>>>> It didn`t work. In fact, nothing beginning with a P or t (or
>>>> even
>>>> a p or a T!) is being deleted, although I have checked the
>>>> wording
>>>> most carefully and it all seems to be correct. Oh well, it looks
>>>> like I shall have to manually delete them after all.
>>>> Disappointing.
>>>
>>> It should work, I think that you're doing something wrong.
>>> Experiment with it at the Command Prompt using the DIR command and
>>> see what the command returns:
>>>
>>> dir /b c:\"folder name\p*.tmp"
>>>
>>> If the DIR command returns a proper list of files that you want to
>>> delete then then there is no reason why the DEL command shouldn't
>>> delete them. Remember that if there are spaces in the path or
>>> file
>>> names that you *must* encapsulate the path with "quotation marks"
>>> (as above) or else the command will fail.
>>>
>>> John
>>
>> The command prompt worked correctly, so I must be doing something
>> wrong creating the .bat. In Notepad, I wrote
>> del \F:\Documents and Settings\(user name)\Local
>> Settings\Temp\p*.tmp
>> del \F:\Documents and Settings\(user name)\Local
>> Settings\Temp\t*.tmp
>
> Don't use the first forward slash in the path and use the quotation
> marks, try it *exactly* like this:
>
> del "F:\Documents and Settings\(user name)\Local
> Settings\Temp\p*.tmp"
> del "F:\Documents and Settings\(user name)\Local
> Settings\Temp\t*.tmp"
>
> John

YeeHa! It worked! Thank you very much indeed, John.

Kate

Leonard Grey[_3_]
December 5th 09, 06:47 PM
While this thread has been going on I have cleaned out my temp folders
142 times.
---
Leonard "The Troublemaker" Grey
Errare humanum est

John John - MVP wrote:
> Kate wrote:
>>
>> "John John - MVP" > wrote in message
>> ...
>>> Kate wrote:
>>>>
>>>> "Kate" > wrote in message
>>>> ...
>>>>>
>>>>> "Bill in Co." > wrote in message
>>>>> ...
>>>>>> Kate wrote:
>>>>>>> "Bill in Co." > wrote in message
>>>>>>> ...
>>>>>>>> Kate wrote:
>>>>>>>>> XP Home SP3
>>>>>>>>> Apologies if this is not the place to ask this question, but I
>>>>>>>>> would like to create a .bat file or something to delete the
>>>>>>>>> dozens of temp files which a program I have leaves in my Temp
>>>>>>>>> folder every time
>>>>>>>>> I run it. The files are always named in a particular way so
>>>>>>>>> can easily be identified, I think/hope. I do not want to
>>>>>>>>> delete all of the files in the Temp folder, though. Is this
>>>>>>>>> possible, please, and how would I go about it?
>>>>>>>>>
>>>>>>>>> Many thanks
>>>>>>>>> Kate
>>>>>>>>
>>>>>>>> The syntax for doing something like that is like this:
>>>>>>>> del \windows\temp\trb*.tmp
>>>>>>>> (In this example we'd be referring to the \windows\temp
>>>>>>>> folder).
>>>>>>>>
>>>>>>>> This would delete all .tmp files in that folder beginning with
>>>>>>>> trb
>>>>>>>> You simply put that line above into a text file created with
>>>>>>>> Notepad, and rename that text file with a .bat extension. You
>>>>>>>> could call it erasetmp.bat.
>>>>>>>>
>>>>>>> Might this work, do you think?
>>>>>>> del\Documents and Settings\(user name)\Local
>>>>>>> Settings\Temp\PTM***.tmp
>>>>>>> del\Documents and Settings\(user name)\Local
>>>>>>> Settings\Temp\t*****.tmp
>>>>>>
>>>>>> As already mentioned, you need to add a space after del command.
>>>>>> Also, make it t*.tmp in the batch file (just one asterisk is
>>>>>> allowed).
>>>>>> An alternate command would be t?????.tmp, but that's not needed
>>>>>> here, but that would specifically ONLY delete filenames (with t,
>>>>>> followed by 5 alphanumeric prefixes). The * is more global:
>>>>>> t*.tmp will delete any filename ending in .tmp that starts with
>>>>>> the letter t.
>>>>>
>>>>> Does that mean the * can be letters and/or numbers, and is a .bat
>>>>> file case-sensitive? I have some TWAIN and Twunk files in my Temp
>>>>> folder and although it doesn`t really matter if they are deleted
>>>>> as they
>>>>> are re-created when I next use my scanner, it would be
>>>>> more...elegant... if the instructions could be targetted at just
>>>>> the Interlok files.
>>>>>
>>>>>>
>>>>>>> The .tmp files always have numbers and/or letters after the PTM
>>>>>>> or t so I have used asterisks as wild-cards. Perhaps more
>>>>>>> importantly, if it doesn`t work, can an incorrectly executed
>>>>>>> .bat file cause problems elsewhere, do you know?
>>>>>>
>>>>>> Well, if you really messed it up, you could delete some other
>>>>>> files you hadn't intended if they matched the conditions
>>>>>> specified in
>>>>>> the batch file, which seems unlikely.
>>>>>>
>>>>>
>>>>> I know these files are useless after the program is closed as I
>>>>> have been manually deleting them without ill-effects after each
>>>>> closure. Most of the other files in my Local Settings/Temp folder
>>>>> are
>>>>> things which just get re-created if I do delete them (see above),
>>>>> so I
>>>>> tend to leave them alone. I think I will give the .bat file a try
>>>>> and
>>>>> see how it goes. I suspect that if it works well, there will be
>>>>> quite
>>>>> a few DxO Optics users celebrating, as it isn`t just me that finds
>>>>> these Interlok files a PITA.
>>>>>
>>>>> Thanks again to all.
>>>>> Kate
>>>>>
>>>>
>>>> It didn`t work. In fact, nothing beginning with a P or t (or even
>>>> a p or a T!) is being deleted, although I have checked the wording
>>>> most carefully and it all seems to be correct. Oh well, it looks
>>>> like I shall have to manually delete them after all. Disappointing.
>>>
>>> It should work, I think that you're doing something wrong.
>>> Experiment with it at the Command Prompt using the DIR command and
>>> see what the command returns:
>>>
>>> dir /b c:\"folder name\p*.tmp"
>>>
>>> If the DIR command returns a proper list of files that you want to
>>> delete then then there is no reason why the DEL command shouldn't
>>> delete them. Remember that if there are spaces in the path or file
>>> names that you *must* encapsulate the path with "quotation marks"
>>> (as above) or else the command will fail.
>>>
>>> John
>>
>> The command prompt worked correctly, so I must be doing something
>> wrong creating the .bat. In Notepad, I wrote
>> del \F:\Documents and Settings\(user name)\Local Settings\Temp\p*.tmp
>> del \F:\Documents and Settings\(user name)\Local Settings\Temp\t*.tmp
>
> Don't use the first forward slash in the path and use the quotation
> marks, try it *exactly* like this:
>
> del "F:\Documents and Settings\(user name)\Local Settings\Temp\p*.tmp"
> del "F:\Documents and Settings\(user name)\Local Settings\Temp\t*.tmp"
>
> John

John John - MVP[_2_]
December 5th 09, 07:10 PM
Kate wrote:

> YeeHa! It worked! Thank you very much indeed, John.

You're welcome. Just a reminder that you have to be extremely careful
when using wildcards to delete files! It might not matter too much with
temp files but with any other files this can be like dynamite!

John

Kate
December 5th 09, 08:14 PM
Erm...what about creating a batch file, Leonard? ;-)

Kate

"Leonard Grey" > wrote in message
...
> While this thread has been going on I have cleaned out my temp
> folders 142 times.
> ---
> Leonard "The Troublemaker" Grey
> Errare humanum est
>
> John John - MVP wrote:
>> Kate wrote:
>>>
>>> "John John - MVP" > wrote in message
>>> ...
>>>> Kate wrote:
>>>>>
>>>>> "Kate" > wrote in message
>>>>> ...
>>>>>>
>>>>>> "Bill in Co." > wrote in message
>>>>>> ...
>>>>>>> Kate wrote:
>>>>>>>> "Bill in Co." > wrote in
>>>>>>>> message
>>>>>>>> ...
>>>>>>>>> Kate wrote:
>>>>>>>>>> XP Home SP3
>>>>>>>>>> Apologies if this is not the place to ask this question,
>>>>>>>>>> but I
>>>>>>>>>> would like to create a .bat file or something to delete the
>>>>>>>>>> dozens of temp files which a program I have leaves in my
>>>>>>>>>> Temp
>>>>>>>>>> folder every time
>>>>>>>>>> I run it. The files are always named in a particular way
>>>>>>>>>> so
>>>>>>>>>> can easily be identified, I think/hope. I do not want to
>>>>>>>>>> delete all of the files in the Temp folder, though. Is
>>>>>>>>>> this
>>>>>>>>>> possible, please, and how would I go about it?
>>>>>>>>>>
>>>>>>>>>> Many thanks
>>>>>>>>>> Kate
>>>>>>>>>
>>>>>>>>> The syntax for doing something like that is like this:
>>>>>>>>> del \windows\temp\trb*.tmp
>>>>>>>>> (In this example we'd be referring to the \windows\temp
>>>>>>>>> folder).
>>>>>>>>>
>>>>>>>>> This would delete all .tmp files in that folder beginning
>>>>>>>>> with
>>>>>>>>> trb
>>>>>>>>> You simply put that line above into a text file created with
>>>>>>>>> Notepad, and rename that text file with a .bat extension.
>>>>>>>>> You
>>>>>>>>> could call it erasetmp.bat.
>>>>>>>>>
>>>>>>>> Might this work, do you think?
>>>>>>>> del\Documents and Settings\(user name)\Local
>>>>>>>> Settings\Temp\PTM***.tmp
>>>>>>>> del\Documents and Settings\(user name)\Local
>>>>>>>> Settings\Temp\t*****.tmp
>>>>>>>
>>>>>>> As already mentioned, you need to add a space after del
>>>>>>> command.
>>>>>>> Also, make it t*.tmp in the batch file (just one asterisk is
>>>>>>> allowed).
>>>>>>> An alternate command would be t?????.tmp, but that's not
>>>>>>> needed
>>>>>>> here, but that would specifically ONLY delete filenames (with
>>>>>>> t,
>>>>>>> followed by 5 alphanumeric prefixes). The * is more global:
>>>>>>> t*.tmp will delete any filename ending in .tmp that starts
>>>>>>> with
>>>>>>> the letter t.
>>>>>>
>>>>>> Does that mean the * can be letters and/or numbers, and is a
>>>>>> .bat
>>>>>> file case-sensitive? I have some TWAIN and Twunk files in my
>>>>>> Temp
>>>>>> folder and although it doesn`t really matter if they are
>>>>>> deleted
>>>>>> as they
>>>>>> are re-created when I next use my scanner, it would be
>>>>>> more...elegant... if the instructions could be targetted at
>>>>>> just
>>>>>> the Interlok files.
>>>>>>
>>>>>>>
>>>>>>>> The .tmp files always have numbers and/or letters after the
>>>>>>>> PTM
>>>>>>>> or t so I have used asterisks as wild-cards. Perhaps more
>>>>>>>> importantly, if it doesn`t work, can an incorrectly executed
>>>>>>>> .bat file cause problems elsewhere, do you know?
>>>>>>>
>>>>>>> Well, if you really messed it up, you could delete some other
>>>>>>> files you hadn't intended if they matched the conditions
>>>>>>> specified in
>>>>>>> the batch file, which seems unlikely.
>>>>>>>
>>>>>>
>>>>>> I know these files are useless after the program is closed as I
>>>>>> have been manually deleting them without ill-effects after each
>>>>>> closure. Most of the other files in my Local Settings/Temp
>>>>>> folder
>>>>>> are
>>>>>> things which just get re-created if I do delete them (see
>>>>>> above),
>>>>>> so I
>>>>>> tend to leave them alone. I think I will give the .bat file a
>>>>>> try
>>>>>> and
>>>>>> see how it goes. I suspect that if it works well, there will
>>>>>> be
>>>>>> quite
>>>>>> a few DxO Optics users celebrating, as it isn`t just me that
>>>>>> finds
>>>>>> these Interlok files a PITA.
>>>>>>
>>>>>> Thanks again to all.
>>>>>> Kate
>>>>>>
>>>>>
>>>>> It didn`t work. In fact, nothing beginning with a P or t (or
>>>>> even
>>>>> a p or a T!) is being deleted, although I have checked the
>>>>> wording
>>>>> most carefully and it all seems to be correct. Oh well, it
>>>>> looks
>>>>> like I shall have to manually delete them after all.
>>>>> Disappointing.
>>>>
>>>> It should work, I think that you're doing something wrong.
>>>> Experiment with it at the Command Prompt using the DIR command
>>>> and
>>>> see what the command returns:
>>>>
>>>> dir /b c:\"folder name\p*.tmp"
>>>>
>>>> If the DIR command returns a proper list of files that you want
>>>> to
>>>> delete then then there is no reason why the DEL command shouldn't
>>>> delete them. Remember that if there are spaces in the path or
>>>> file
>>>> names that you *must* encapsulate the path with "quotation marks"
>>>> (as above) or else the command will fail.
>>>>
>>>> John
>>>
>>> The command prompt worked correctly, so I must be doing something
>>> wrong creating the .bat. In Notepad, I wrote
>>> del \F:\Documents and Settings\(user name)\Local
>>> Settings\Temp\p*.tmp
>>> del \F:\Documents and Settings\(user name)\Local
>>> Settings\Temp\t*.tmp
>>
>> Don't use the first forward slash in the path and use the quotation
>> marks, try it *exactly* like this:
>>
>> del "F:\Documents and Settings\(user name)\Local
>> Settings\Temp\p*.tmp"
>> del "F:\Documents and Settings\(user name)\Local
>> Settings\Temp\t*.tmp"
>>
>> John

Kate
December 5th 09, 11:52 PM
"John John - MVP" > wrote in message
...
> Kate wrote:
>
>> YeeHa! It worked! Thank you very much indeed, John.
>
> You're welcome. Just a reminder that you have to be extremely
> careful when using wildcards to delete files! It might not matter
> too much with temp files but with any other files this can be like
> dynamite!
>
> John

Yes, indeed! I do not know if you were around in the days of Win
98SE, but there was one charming poster to the ms help and support NG
who used to reply to pleas for help with the instruction to use the
deltree y command, saying that all the OP`s problems would be solved
if they ran it. Fortunately, I never got caught, but all the warnings
which were posted at the time have made me cautious about any "del"
command. Thank you for the warning, though.

Kate

Bill Sharpe
December 7th 09, 09:16 PM
Leonard Grey wrote:
> While this thread has been going on I have cleaned out my temp folders
> 142 times.
> ---

Surely you jest, Leonard! The thread's just 24 hours old.

Kate's right. You could use a batch file...

Bill

Kate
December 7th 09, 10:51 PM
I`m glad you posted, Bill, because it has given me a chance to ask
for more help, please?

The same program that I have been grumbling about puts a "Hidden"
folder in my Documents and Settings\(user)\Cookies folder. Because I
have "Show Hidden Files & Folders" checked, I am able to see it, but
cannot delete it using the line

del "F:\Documents and Settings\(user)\Cookies\(folder name)"

The contents of the folder are deleted, but not the folder.
What sort of wording should I use to delete the folder itself and its
contents, please?

Many thanks
Kate

"Bill Sharpe" > wrote in message
.. .
> Leonard Grey wrote:
>> While this thread has been going on I have cleaned out my temp
>> folders 142 times.
>> ---
>
> Surely you jest, Leonard! The thread's just 24 hours old.
>
> Kate's right. You could use a batch file...
>
> Bill

Leonard Grey[_3_]
December 7th 09, 11:33 PM
Au contraire, Bill. Since it takes less than 3 seconds for me to click
twice on CCleaner, I could have cleared my temp files thousands of times
in a 24-hour period.

And as you'll soon find out, this thread is still not over. ;-)
---
Leonard Grey
Errare humanum est

Bill Sharpe wrote:
> Leonard Grey wrote:
>> While this thread has been going on I have cleaned out my temp folders
>> 142 times.
>> ---
>
> Surely you jest, Leonard! The thread's just 24 hours old.
>
> Kate's right. You could use a batch file...
>
> Bill

John John - MVP[_2_]
December 7th 09, 11:46 PM
Use the RD command.

rd /s /q "F:\Documents and Settings\(user)\Cookies\(folder name)"

At the Command Prompt do RD /? for information on the switches.

John

Kate wrote:
> I`m glad you posted, Bill, because it has given me a chance to ask
> for more help, please?
>
> The same program that I have been grumbling about puts a "Hidden"
> folder in my Documents and Settings\(user)\Cookies folder. Because I
> have "Show Hidden Files & Folders" checked, I am able to see it, but
> cannot delete it using the line
>
> del "F:\Documents and Settings\(user)\Cookies\(folder name)"
>
> The contents of the folder are deleted, but not the folder.
> What sort of wording should I use to delete the folder itself and its
> contents, please?
>
> Many thanks
> Kate
>
> "Bill Sharpe" > wrote in message
> .. .
>> Leonard Grey wrote:
>>> While this thread has been going on I have cleaned out my temp
>>> folders 142 times.
>>> ---
>>
>> Surely you jest, Leonard! The thread's just 24 hours old.
>>
>> Kate's right. You could use a batch file...
>>
>> Bill
>

Bill in Co.
December 8th 09, 01:07 AM
Adding to what John here said, "rd" stands for remove directory, Kate.
Another good and powerful command is "deltree" - just be very careful if
and when you use it. Deltree deletes everything in the directory, even if
its not empty, which I don't think "rd" will do. You can look it up on the
net.

John John - MVP wrote:
> Use the RD command.
>
> rd /s /q "F:\Documents and Settings\(user)\Cookies\(folder name)"
>
> At the Command Prompt do RD /? for information on the switches.
>
> John
>
> Kate wrote:
>> I`m glad you posted, Bill, because it has given me a chance to ask
>> for more help, please?
>>
>> The same program that I have been grumbling about puts a "Hidden"
>> folder in my Documents and Settings\(user)\Cookies folder. Because I
>> have "Show Hidden Files & Folders" checked, I am able to see it, but
>> cannot delete it using the line
>>
>> del "F:\Documents and Settings\(user)\Cookies\(folder name)"
>>
>> The contents of the folder are deleted, but not the folder.
>> What sort of wording should I use to delete the folder itself and its
>> contents, please?
>>
>> Many thanks
>> Kate
>>
>> "Bill Sharpe" > wrote in message
>> .. .
>>> Leonard Grey wrote:
>>>> While this thread has been going on I have cleaned out my temp
>>>> folders 142 times.
>>>> ---
>>>
>>> Surely you jest, Leonard! The thread's just 24 hours old.
>>>
>>> Kate's right. You could use a batch file...
>>>
>>> Bill

John John - MVP[_2_]
December 8th 09, 02:00 AM
Bill in Co. wrote:

> Deltree deletes everything in the directory, even if
> its not empty, which I don't think "rd" will do.

That is what the /s switch is for. Do rd /?

John

Bill in Co.
December 8th 09, 02:25 AM
Oh, ok.
Haven't used rd in ages, but have used deltree somewhat recently.

John John - MVP wrote:
> Bill in Co. wrote:
>
>> Deltree deletes everything in the directory, even if
>> its not empty, which I don't think "rd" will do.
>
> That is what the /s switch is for. Do rd /?
>
> John

SC Tom[_3_]
December 8th 09, 12:47 PM
Deltree is not available in XP Home, unless you got it from somewhere else?
--
SC Tom

"Bill in Co." > wrote in message
...
> Oh, ok.
> Haven't used rd in ages, but have used deltree somewhat recently.
>
> John John - MVP wrote:
>> Bill in Co. wrote:
>>
>>> Deltree deletes everything in the directory, even if
>>> its not empty, which I don't think "rd" will do.
>>
>> That is what the /s switch is for. Do rd /?
>>
>> John
>
>

Kate
December 8th 09, 12:53 PM
As you will see in my reply to John, "rd" removed the folder, so I
assume its contents were also deleted. They are not in the Cookies
folder, anyway.
Re the deltree command, I really would prefer to avoid using it
because of all the dread warnings years ago about deltree y (see my
earlier post about Win98).

Kate


"Bill in Co." > wrote in message
...
> Adding to what John here said, "rd" stands for remove directory,
> Kate. Another good and powerful command is "deltree" - just be very
> careful if and when you use it. Deltree deletes everything in the
> directory, even if its not empty, which I don't think "rd" will do.
> You can look it up on the net.
>
> John John - MVP wrote:
>> Use the RD command.
>>
>> rd /s /q "F:\Documents and Settings\(user)\Cookies\(folder name)"
>>
>> At the Command Prompt do RD /? for information on the switches.
>>
>> John
>>
>> Kate wrote:
>>> I`m glad you posted, Bill, because it has given me a chance to ask
>>> for more help, please?
>>>
>>> The same program that I have been grumbling about puts a "Hidden"
>>> folder in my Documents and Settings\(user)\Cookies folder.
>>> Because I
>>> have "Show Hidden Files & Folders" checked, I am able to see it,
>>> but
>>> cannot delete it using the line
>>>
>>> del "F:\Documents and Settings\(user)\Cookies\(folder name)"
>>>
>>> The contents of the folder are deleted, but not the folder.
>>> What sort of wording should I use to delete the folder itself and
>>> its
>>> contents, please?
>>>
>>> Many thanks
>>> Kate
>>>
>>> "Bill Sharpe" > wrote in message
>>> .. .
>>>> Leonard Grey wrote:
>>>>> While this thread has been going on I have cleaned out my temp
>>>>> folders 142 times.
>>>>> ---
>>>>
>>>> Surely you jest, Leonard! The thread's just 24 hours old.
>>>>
>>>> Kate's right. You could use a batch file...
>>>>
>>>> Bill
>
>

Kate
December 8th 09, 12:54 PM
Thank you very much once again, John. Works a treat.
Somebody told me that the % sign can be used instead of writing out
the whole path, but, as a complete DOS novice, I think I would rather
see the full path so that I can easily see if I have made any
mistakes.

Kate

"John John - MVP" > wrote in message
...
> Use the RD command.
>
> rd /s /q "F:\Documents and Settings\(user)\Cookies\(folder name)"
>
> At the Command Prompt do RD /? for information on the switches.
>
> John
>
> Kate wrote:
>> I`m glad you posted, Bill, because it has given me a chance to ask
>> for more help, please?
>>
>> The same program that I have been grumbling about puts a "Hidden"
>> folder in my Documents and Settings\(user)\Cookies folder. Because
>> I
>> have "Show Hidden Files & Folders" checked, I am able to see it,
>> but
>> cannot delete it using the line
>>
>> del "F:\Documents and Settings\(user)\Cookies\(folder name)"
>>
>> The contents of the folder are deleted, but not the folder.
>> What sort of wording should I use to delete the folder itself and
>> its
>> contents, please?
>>
>> Many thanks
>> Kate
>>
>> "Bill Sharpe" > wrote in message
>> .. .
>>> Leonard Grey wrote:
>>>> While this thread has been going on I have cleaned out my temp
>>>> folders 142 times.
>>>> ---
>>>
>>> Surely you jest, Leonard! The thread's just 24 hours old.
>>>
>>> Kate's right. You could use a batch file...
>>>
>>> Bill
>>

John John - MVP[_2_]
December 8th 09, 03:58 PM
You're welcome. By the % they meant that you can use variables in the
batch file. For more information open a command prompt and issue the
SET command and you will see some of the variables.

While at the command prompt you can experiment with the CD command and
see the results:

cd \

cd %userprofile%

cd %systemroot%

cd %appdata%

cd %windir%

Someone writing a batch file for use on other people's computer wouldn't
know their user names or profile folder path so they would use the
variable to make sure that the command runs properly:

echo %userprofile%\cookies

The cd and echo commands work even if there are spaces in the path but
most other commands still need to use "quotation marks" to ensure that
the command runs properly, for example the MD (Make Directory) command
without quotation marks:

md %userprofile\TestFolder

will have unexpected results, there will be no TestFolder in the
expected user folder at C:\Documents and Settings but there will be
several new folders in the root of the c: drive, to run properly the
command needs quotation marks:

md "%userprofile\TestFolder"

John

Kate wrote:
> Thank you very much once again, John. Works a treat.
> Somebody told me that the % sign can be used instead of writing out
> the whole path, but, as a complete DOS novice, I think I would rather
> see the full path so that I can easily see if I have made any
> mistakes.
>
> Kate
>
> "John John - MVP" > wrote in message
> ...
>> Use the RD command.
>>
>> rd /s /q "F:\Documents and Settings\(user)\Cookies\(folder name)"
>>
>> At the Command Prompt do RD /? for information on the switches.
>>
>> John
>>
>> Kate wrote:
>>> I`m glad you posted, Bill, because it has given me a chance to ask
>>> for more help, please?
>>>
>>> The same program that I have been grumbling about puts a "Hidden"
>>> folder in my Documents and Settings\(user)\Cookies folder. Because
>>> I
>>> have "Show Hidden Files & Folders" checked, I am able to see it,
>>> but
>>> cannot delete it using the line
>>>
>>> del "F:\Documents and Settings\(user)\Cookies\(folder name)"
>>>
>>> The contents of the folder are deleted, but not the folder.
>>> What sort of wording should I use to delete the folder itself and
>>> its
>>> contents, please?
>>>
>>> Many thanks
>>> Kate
>>>
>>> "Bill Sharpe" > wrote in message
>>> .. .
>>>> Leonard Grey wrote:
>>>>> While this thread has been going on I have cleaned out my temp
>>>>> folders 142 times.
>>>>> ---
>>>>
>>>> Surely you jest, Leonard! The thread's just 24 hours old.
>>>>
>>>> Kate's right. You could use a batch file...
>>>>
>>>> Bill
>>>
>

Bill Sharpe
December 8th 09, 05:23 PM
SC Tom wrote:
> Deltree is not available in XP Home, unless you got it from somewhere else?

It doesn't seem to be available in XP Pro either, at least on my
machine. No matter, rd /s works just fine, if needed.

Bill

Bill in Co.
December 8th 09, 07:42 PM
It's on my DOS flash disk, where I had been using it. Now that you mention
it, I guess it would be useless on XP with NTFS. My Bad.

SC Tom wrote:
> Deltree is not available in XP Home, unless you got it from somewhere
> else?
> --
> SC Tom
>
> "Bill in Co." > wrote in message
> ...
>> Oh, ok.
>> Haven't used rd in ages, but have used deltree somewhat recently.
>>
>> John John - MVP wrote:
>>> Bill in Co. wrote:
>>>
>>>> Deltree deletes everything in the directory, even if
>>>> its not empty, which I don't think "rd" will do.
>>>
>>> That is what the /s switch is for. Do rd /?
>>>
>>> John

Kate
December 9th 09, 03:20 PM
Thank you for the explanations, John.
I see that one of your examples uses "echo". I used the echo /?
command to find out more, but all that was mentioned was echo on and
echo off, not what it actually does. Another user of the program that
creates all the unwanted temp files has written a batch file but for
Win 4NT, and I gather that the wording will be different to a batch
file for Win XP. He has written his .bat so that, 30 seconds after he
closes the program, the rest of the batch file will run automatically
and clean up the temp files. The entries he has written are :

@echo off
"C:\Program Files\DxO Labs\DxO Optics Pro v6\DxOOpticsPro6.exe"
delay 30

followed by the del instructions. Will these three lines as written
work for the batch file you have helped me with, please? I ran a
@ /? command but the details said it was not recognised, so I am
reluctant to experiment and add these lines to my .bat without advice
in case something goes very wrong.

Thanks
Kate

"John John - MVP" > wrote in message
...
> You're welcome. By the % they meant that you can use variables in
> the batch file. For more information open a command prompt and
> issue the SET command and you will see some of the variables.
>
> While at the command prompt you can experiment with the CD command
> and see the results:
>
> cd \
>
> cd %userprofile%
>
> cd %systemroot%
>
> cd %appdata%
>
> cd %windir%
>
> Someone writing a batch file for use on other people's computer
> wouldn't know their user names or profile folder path so they would
> use the variable to make sure that the command runs properly:
>
> echo %userprofile%\cookies
>
> The cd and echo commands work even if there are spaces in the path
> but most other commands still need to use "quotation marks" to
> ensure that the command runs properly, for example the MD (Make
> Directory) command without quotation marks:
>
> md %userprofile\TestFolder
>
> will have unexpected results, there will be no TestFolder in the
> expected user folder at C:\Documents and Settings but there will be
> several new folders in the root of the c: drive, to run properly the
> command needs quotation marks:
>
> md "%userprofile\TestFolder"
>
> John
>
> Kate wrote:
>> Thank you very much once again, John. Works a treat.
>> Somebody told me that the % sign can be used instead of writing out
>> the whole path, but, as a complete DOS novice, I think I would
>> rather
>> see the full path so that I can easily see if I have made any
>> mistakes.
>>
>> Kate
>>
>> "John John - MVP" > wrote in message
>> ...
>>> Use the RD command.
>>>
>>> rd /s /q "F:\Documents and Settings\(user)\Cookies\(folder name)"
>>>
>>> At the Command Prompt do RD /? for information on the switches.
>>>
>>> John
>>>
>>> Kate wrote:
>>>> I`m glad you posted, Bill, because it has given me a chance to
>>>> ask
>>>> for more help, please?
>>>>
>>>> The same program that I have been grumbling about puts a "Hidden"
>>>> folder in my Documents and Settings\(user)\Cookies folder.
>>>> Because
>>>> I
>>>> have "Show Hidden Files & Folders" checked, I am able to see it,
>>>> but
>>>> cannot delete it using the line
>>>>
>>>> del "F:\Documents and Settings\(user)\Cookies\(folder name)"
>>>>
>>>> The contents of the folder are deleted, but not the folder.
>>>> What sort of wording should I use to delete the folder itself and
>>>> its
>>>> contents, please?
>>>>
>>>> Many thanks
>>>> Kate
>>>>
>>>> "Bill Sharpe" > wrote in message
>>>> .. .
>>>>> Leonard Grey wrote:
>>>>>> While this thread has been going on I have cleaned out my temp
>>>>>> folders 142 times.
>>>>>> ---
>>>>>
>>>>> Surely you jest, Leonard! The thread's just 24 hours old.
>>>>>
>>>>> Kate's right. You could use a batch file...
>>>>>
>>>>> Bill
>>>>
>>

John John - MVP[_2_]
December 10th 09, 12:39 AM
It echoes... try these:

echo Merry Christmas

echo Kate

echo Merry Christmas %username%!

These user variables continue to be in place in all NT versions, some of
them were probably in place in Windows 3.x and Windows 95, the 'ol' pros
would know this...

Batches written for NT4 will run on XP as long as they are not trying to
execute unknown or forbidden commands, and vice-versa.

If you want help with the batch file you need to reveal more of its
contents or you should reveal the source of the file. 'Delay' is not a
valid Windows command, this is probably just pinging the loopback
adapter for 30 seconds. Try this inoffensive command:

ping google.com

now get your stopwatch and time this:

ping google.com -n 29

John

Kate wrote:
> Thank you for the explanations, John.
> I see that one of your examples uses "echo". I used the echo /?
> command to find out more, but all that was mentioned was echo on and
> echo off, not what it actually does. Another user of the program that
> creates all the unwanted temp files has written a batch file but for
> Win 4NT, and I gather that the wording will be different to a batch
> file for Win XP. He has written his .bat so that, 30 seconds after he
> closes the program, the rest of the batch file will run automatically
> and clean up the temp files. The entries he has written are :
>
> @echo off
> "C:\Program Files\DxO Labs\DxO Optics Pro v6\DxOOpticsPro6.exe"
> delay 30
>
> followed by the del instructions. Will these three lines as written
> work for the batch file you have helped me with, please? I ran a
> @ /? command but the details said it was not recognised, so I am
> reluctant to experiment and add these lines to my .bat without advice
> in case something goes very wrong.
>
> Thanks
> Kate
>
> "John John - MVP" > wrote in message
> ...
>> You're welcome. By the % they meant that you can use variables in
>> the batch file. For more information open a command prompt and
>> issue the SET command and you will see some of the variables.
>>
>> While at the command prompt you can experiment with the CD command
>> and see the results:
>>
>> cd \
>>
>> cd %userprofile%
>>
>> cd %systemroot%
>>
>> cd %appdata%
>>
>> cd %windir%
>>
>> Someone writing a batch file for use on other people's computer
>> wouldn't know their user names or profile folder path so they would
>> use the variable to make sure that the command runs properly:
>>
>> echo %userprofile%\cookies
>>
>> The cd and echo commands work even if there are spaces in the path
>> but most other commands still need to use "quotation marks" to
>> ensure that the command runs properly, for example the MD (Make
>> Directory) command without quotation marks:
>>
>> md %userprofile\TestFolder
>>
>> will have unexpected results, there will be no TestFolder in the
>> expected user folder at C:\Documents and Settings but there will be
>> several new folders in the root of the c: drive, to run properly the
>> command needs quotation marks:
>>
>> md "%userprofile\TestFolder"
>>
>> John
>>
>> Kate wrote:
>>> Thank you very much once again, John. Works a treat.
>>> Somebody told me that the % sign can be used instead of writing out
>>> the whole path, but, as a complete DOS novice, I think I would
>>> rather
>>> see the full path so that I can easily see if I have made any
>>> mistakes.
>>>
>>> Kate
>>>
>>> "John John - MVP" > wrote in message
>>> ...
>>>> Use the RD command.
>>>>
>>>> rd /s /q "F:\Documents and Settings\(user)\Cookies\(folder name)"
>>>>
>>>> At the Command Prompt do RD /? for information on the switches.
>>>>
>>>> John
>>>>
>>>> Kate wrote:
>>>>> I`m glad you posted, Bill, because it has given me a chance to
>>>>> ask
>>>>> for more help, please?
>>>>>
>>>>> The same program that I have been grumbling about puts a "Hidden"
>>>>> folder in my Documents and Settings\(user)\Cookies folder.
>>>>> Because
>>>>> I
>>>>> have "Show Hidden Files & Folders" checked, I am able to see it,
>>>>> but
>>>>> cannot delete it using the line
>>>>>
>>>>> del "F:\Documents and Settings\(user)\Cookies\(folder name)"
>>>>>
>>>>> The contents of the folder are deleted, but not the folder.
>>>>> What sort of wording should I use to delete the folder itself and
>>>>> its
>>>>> contents, please?
>>>>>
>>>>> Many thanks
>>>>> Kate
>>>>>
>>>>> "Bill Sharpe" > wrote in message
>>>>> .. .
>>>>>> Leonard Grey wrote:
>>>>>>> While this thread has been going on I have cleaned out my temp
>>>>>>> folders 142 times.
>>>>>>> ---
>>>>>>
>>>>>> Surely you jest, Leonard! The thread's just 24 hours old.
>>>>>>
>>>>>> Kate's right. You could use a batch file...
>>>>>>
>>>>>> Bill
>>>>>
>>>
>

Kate
December 10th 09, 11:40 AM
That was interesting!
The batch file I mentioned was written so that the application could
be launched by double-clicking the .btm (in his case), then after 30
seconds, the temp files would be deleted, although the application
would still be running (I think!). However, I don`t think it is worth
going any further with this after all, as it is no big thing to just
dbl-click the batch I have at the moment and clear the files after I
close the app.

With thanks and best wishes for Christmas and 2010

Kate

"John John - MVP" > wrote in message
...
> It echoes... try these:
>
> echo Merry Christmas
>
> echo Kate
>
> echo Merry Christmas %username%!
>
> These user variables continue to be in place in all NT versions,
> some of them were probably in place in Windows 3.x and Windows 95,
> the 'ol' pros would know this...
>
> Batches written for NT4 will run on XP as long as they are not
> trying to execute unknown or forbidden commands, and vice-versa.
>
> If you want help with the batch file you need to reveal more of its
> contents or you should reveal the source of the file. 'Delay' is
> not a valid Windows command, this is probably just pinging the
> loopback adapter for 30 seconds. Try this inoffensive command:
>
> ping google.com
>
> now get your stopwatch and time this:
>
> ping google.com -n 29
>
> John
>
> Kate wrote:
>> Thank you for the explanations, John.
>> I see that one of your examples uses "echo". I used the echo /?
>> command to find out more, but all that was mentioned was echo on
>> and
>> echo off, not what it actually does. Another user of the program
>> that
>> creates all the unwanted temp files has written a batch file but
>> for
>> Win 4NT, and I gather that the wording will be different to a batch
>> file for Win XP. He has written his .bat so that, 30 seconds after
>> he
>> closes the program, the rest of the batch file will run
>> automatically
>> and clean up the temp files. The entries he has written are :
>>
>> @echo off
>> "C:\Program Files\DxO Labs\DxO Optics Pro v6\DxOOpticsPro6.exe"
>> delay 30
>>
>> followed by the del instructions. Will these three lines as written
>> work for the batch file you have helped me with, please? I ran a
>> @ /? command but the details said it was not recognised, so I am
>> reluctant to experiment and add these lines to my .bat without
>> advice
>> in case something goes very wrong.
>>
>> Thanks
>> Kate
>>
>> "John John - MVP" > wrote in message
>> ...
>>> You're welcome. By the % they meant that you can use variables in
>>> the batch file. For more information open a command prompt and
>>> issue the SET command and you will see some of the variables.
>>>
>>> While at the command prompt you can experiment with the CD command
>>> and see the results:
>>>
>>> cd \
>>>
>>> cd %userprofile%
>>>
>>> cd %systemroot%
>>>
>>> cd %appdata%
>>>
>>> cd %windir%
>>>
>>> Someone writing a batch file for use on other people's computer
>>> wouldn't know their user names or profile folder path so they
>>> would
>>> use the variable to make sure that the command runs properly:
>>>
>>> echo %userprofile%\cookies
>>>
>>> The cd and echo commands work even if there are spaces in the path
>>> but most other commands still need to use "quotation marks" to
>>> ensure that the command runs properly, for example the MD (Make
>>> Directory) command without quotation marks:
>>>
>>> md %userprofile\TestFolder
>>>
>>> will have unexpected results, there will be no TestFolder in the
>>> expected user folder at C:\Documents and Settings but there will
>>> be
>>> several new folders in the root of the c: drive, to run properly
>>> the
>>> command needs quotation marks:
>>>
>>> md "%userprofile\TestFolder"
>>>
>>> John
>>>
>>> Kate wrote:
>>>> Thank you very much once again, John. Works a treat.
>>>> Somebody told me that the % sign can be used instead of writing
>>>> out
>>>> the whole path, but, as a complete DOS novice, I think I would
>>>> rather
>>>> see the full path so that I can easily see if I have made any
>>>> mistakes.
>>>>
>>>> Kate
>>>>
>>>> "John John - MVP" > wrote in message
>>>> ...
>>>>> Use the RD command.
>>>>>
>>>>> rd /s /q "F:\Documents and Settings\(user)\Cookies\(folder
>>>>> name)"
>>>>>
>>>>> At the Command Prompt do RD /? for information on the switches.
>>>>>
>>>>> John
>>>>>
>>>>> Kate wrote:
>>>>>> I`m glad you posted, Bill, because it has given me a chance to
>>>>>> ask
>>>>>> for more help, please?
>>>>>>
>>>>>> The same program that I have been grumbling about puts a
>>>>>> "Hidden"
>>>>>> folder in my Documents and Settings\(user)\Cookies folder.
>>>>>> Because
>>>>>> I
>>>>>> have "Show Hidden Files & Folders" checked, I am able to see
>>>>>> it,
>>>>>> but
>>>>>> cannot delete it using the line
>>>>>>
>>>>>> del "F:\Documents and Settings\(user)\Cookies\(folder name)"
>>>>>>
>>>>>> The contents of the folder are deleted, but not the folder.
>>>>>> What sort of wording should I use to delete the folder itself
>>>>>> and
>>>>>> its
>>>>>> contents, please?
>>>>>>
>>>>>> Many thanks
>>>>>> Kate
>>>>>>
>>>>>> "Bill Sharpe" > wrote in message
>>>>>> .. .
>>>>>>> Leonard Grey wrote:
>>>>>>>> While this thread has been going on I have cleaned out my
>>>>>>>> temp
>>>>>>>> folders 142 times.
>>>>>>>> ---
>>>>>>>
>>>>>>> Surely you jest, Leonard! The thread's just 24 hours old.
>>>>>>>
>>>>>>> Kate's right. You could use a batch file...
>>>>>>>
>>>>>>> Bill
>>>>>>
>>>>
>>

Richard[_12_]
December 12th 09, 02:17 PM
> "Kate" > wrote in message
> ...
> Thank you very much once again, John. Works a treat.
> Somebody told me that the % sign can be used instead of writing out
> the whole path, but, as a complete DOS novice, I think I would rather
> see the full path so that I can easily see if I have made any
> mistakes.
>
> Kate

Hi Kate,

Yes, the % sign is used in environment variables.
You could use something like this in your batch file:

del /Q "%UserProfile%\Local Settings\Temp\PTM*.tmp"
del /Q "%UserProfile%\Local Settings\Temp\t*.tmp"

This works the same on my system:

del /Q "%Temp%\PTM*.tmp"
del /Q "%Temp%\t*.tmp"

/Q is Quiet Mode - it deletes without asking if OK when using wildcards.

When I do this at Command Prompt:
echo %temp%
I get this:
C:\DOCUME~1\Richard\LOCALS~1\Temp
Which is short for:
C:\Documents and Settings\Richard\Local Settings\temp

HTH. (Hope This Helps. :)
--Richard

- - -
> "John John - MVP" > wrote in message
> ...
>> Use the RD command.
>>
>> rd /s /q "F:\Documents and Settings\(user)\Cookies\(folder name)"
>>
>> At the Command Prompt do RD /? for information on the switches.
>>
>> John
>>
>> Kate wrote:
>>> I`m glad you posted, Bill, because it has given me a chance to ask
>>> for more help, please?
>>>
>>> The same program that I have been grumbling about puts a "Hidden"
>>> folder in my Documents and Settings\(user)\Cookies folder. Because
>>> I
>>> have "Show Hidden Files & Folders" checked, I am able to see it,
>>> but
>>> cannot delete it using the line
>>>
>>> del "F:\Documents and Settings\(user)\Cookies\(folder name)"
>>>
>>> The contents of the folder are deleted, but not the folder.
>>> What sort of wording should I use to delete the folder itself and
>>> its
>>> contents, please?
>>>
>>> Many thanks
>>> Kate
- - -

Kate
December 12th 09, 03:54 PM
Thanks for explaining this, Richard, but I finally lost all patience
with the troublesome app and uninstalled it. Apologies to you, John
and everyone else who helped me for wasting your time, although I did
learn something about batch files for future reference, so, from my
point of view, it wasn`t a wasted exercise.

Kate

"Richard" > wrote in message
...
>> "Kate" > wrote in message
>> ...
>> Thank you very much once again, John. Works a treat.
>> Somebody told me that the % sign can be used instead of writing out
>> the whole path, but, as a complete DOS novice, I think I would
>> rather
>> see the full path so that I can easily see if I have made any
>> mistakes.
>>
>> Kate
>
> Hi Kate,
>
> Yes, the % sign is used in environment variables.
> You could use something like this in your batch file:
>
> del /Q "%UserProfile%\Local Settings\Temp\PTM*.tmp"
> del /Q "%UserProfile%\Local Settings\Temp\t*.tmp"
>
> This works the same on my system:
>
> del /Q "%Temp%\PTM*.tmp"
> del /Q "%Temp%\t*.tmp"
>
> /Q is Quiet Mode - it deletes without asking if OK when using
> wildcards.
>
> When I do this at Command Prompt:
> echo %temp%
> I get this:
> C:\DOCUME~1\Richard\LOCALS~1\Temp
> Which is short for:
> C:\Documents and Settings\Richard\Local Settings\temp
>
> HTH. (Hope This Helps. :)
> --Richard
>
> - - -
>> "John John - MVP" > wrote in message
>> ...
>>> Use the RD command.
>>>
>>> rd /s /q "F:\Documents and Settings\(user)\Cookies\(folder name)"
>>>
>>> At the Command Prompt do RD /? for information on the switches.
>>>
>>> John
>>>
>>> Kate wrote:
>>>> I`m glad you posted, Bill, because it has given me a chance to
>>>> ask
>>>> for more help, please?
>>>>
>>>> The same program that I have been grumbling about puts a "Hidden"
>>>> folder in my Documents and Settings\(user)\Cookies folder.
>>>> Because
>>>> I
>>>> have "Show Hidden Files & Folders" checked, I am able to see it,
>>>> but
>>>> cannot delete it using the line
>>>>
>>>> del "F:\Documents and Settings\(user)\Cookies\(folder name)"
>>>>
>>>> The contents of the folder are deleted, but not the folder.
>>>> What sort of wording should I use to delete the folder itself and
>>>> its
>>>> contents, please?
>>>>
>>>> Many thanks
>>>> Kate
> - - -
>
>

Google