PDA

View Full Version : word 97 - how to delete temp files?


andrbea
05-30-2001, 04:34 AM
after a crash with Word open (and say 10 work files), Winword (in all its subdirectories) creates temp files, by default.

Can I delete these in my autoexec file by adding a line or two?
At present I have to delete per subdirectory with Windows Explorer which is time-consuming and dangerous (could delete the wrong file)

I already have 2 lines (set temp or something and deltree) in my autoexec file, but these stubborn "Word temps", at the subdirectory level) aren't deleted by it:

Any ideas?

Tks,


Andrew

bassman
05-30-2001, 10:12 AM
Hello Andrew and welcome http://www.PCGuide.com/ubb/wink.gif
I hope I uderstand what you are asking in that you want autoexec.bat to delete your Temp folders. You Do Not Want To Do This. If you add a line to this batch file that would do it, every time it crashes and you restart, it automaticly wipes out what it was trying to save for you.
The reason it's so tedious to delete folders and files is to make you think about what you are doing.
You can select multipul folders and files by holding down the shift key and selecting each item or if they are in consecutive order, select the first one, hold Ctrl and select the last one and it will take everything in between. Then hit Delete.
Have fun http://www.PCGuide.com/ubb/cool.gif

------------------
They say to eat before you go to the grocery store so you don't buy so much. That doesn't work at the liquor store does it!

tjaymadison
05-30-2001, 10:21 AM
Word was doing everything it was supposed to at the time of the crash.

In fact, if you weren't able to save your work before the crash, you may
be able to rescue some of it by renaming those files with .tmp extensions
to .doc, and then opening those files in Word and re-saving under a new
name. If you don't need to, you can get a list of them with the Find tool.

Click Start > Find > Files or Folders. In the 'Named' box, type *.tmp
In the 'Look in' box, select the drive or folder where Word is installed.
Click 'Find Now'. When the search is complete, you can highlight any or
all files in the lower pane, click File, then click Delete.

Are you using Windows 98? If so, I'm not sure why you have an Autoexec.bat
file at all. It's most often not required, and usually slows things down.

------------------
"I am not able to rightly apprehend the kind of confusion of ideas that could provoke such a question."
-- Charles Babbage, mathematician, computer pioneer, analytical engine designer (1791-1871)
-- (Question: 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?')

"Just because I don't care, doesn't mean I don't understand."
-- Homer Simpson


[This message has been edited by tjaymadison (edited 05-30-2001).]

andrbea
05-30-2001, 10:27 AM
I understand your concerns.
i.e. that the normal user shouldn't want to delete his temps for reasons of backup and autorestore. Quite right too.
But recently i discovered the trick:

depress shift key
with mouse on "file" tab in word, scroll down
you then get 2 extra options (that you never had before)
save all
and close all

i use this a lot as I have 7 reference files open for every day I work in Word.
And these files total around 1400 pages.

So every 15 min or so, I do a save all. that way I don't lose much work at all.

I don't want temps of these files in winword as with every crash that's an extra 1500 pages + my tiny workfile. And that bugs me more than a lost auto-restore.

can't I do a del-tree in autoexec or something for all the files in winword of type .tmp?

http://www.PCGuide.com/ubb/wink.gif

Paleo Pete
05-30-2001, 05:30 PM
I agree with the above, do it manually. It's a hassle, but safer. If you do it manually you might be able to restore what you were working on as described above, and can delete the extras fairly easily.

Bassman has the procedure correct, but the keys backward. Shift will highlight everything at once, Ctrl highlights individual files no matter where in the list they are, just click the file you want to highlight and look for the next one.

Next suggestion: Find out what's crashing the machine and try to fix it so you don't have to worry about the temp files. You're trying to treat the symptom, not the disease...

------------------
So many idiots, and only six bullets...
Note: Please post your questions on the forums, not in my email.

Computer Information Links (http://www.geocities.com/paleopete/)

andrbea
05-31-2001, 03:30 AM
Thanks Paleo Pete for your reply. What a great board this is.

1 reason I don't like the manual route is because I accidentally deleted an important word file last week with a "block" delete. Luckily I have 2-week old backups on a ZIP diskette.

The crashes are probably a conflict between I Explorer - Macfee virus Scan 4 - Media Player, Zone Alarm, Airy Systems (password help) (Ads Off - advertising banner blocker) or something else. Still looking for the reason ....

Manual cleaning of telmp files:

if, in Windows Explorer, I sort a Word subdirectory (for all my work in the month of May) of say 144 files by "date" the say 40 temp files (from my crashes) are muddled up with the word files. So that's difficult to block delete (ie only the temp files) with the shift key - result: I accidentally deleted a word file in amongst them.
Alternatively, if you sort by "type of file", the latest (active) temp files are included, of course, in the block of temp files and the block delete will give you a warning - can't delete! - so you have to block delete (with the mouse + shift) around the current date files, so as to leave them standing.
So neither method is very quick.

Talk about hassle-free!

As you can tell, I loathe temp files ....

Onr bright spot:
I've got VOPT installed (costs 20$) which deletes all my Internet and non-Word temp files for me (including the stubborn IE5 ones that Windows Internet Options doesn't delete). So that's one blessing.
It's also got a lighting quick fragmenter and will also clean your cookies.

http://www.PCGuide.com/ubb/cool.gif

andrbea
05-31-2001, 03:44 AM
Tks Paleo Pete

Still looking for the crash cause:
Probabaly a conflict bewteen I Explorer 5.5 - Outlook Express - Airy systems (Password help) - Ads Off - Zone Alarm - Cacheman ....
Difficult to isolate.

How I delete temp files manually
it's not exactly hassle free is it?
Method 1
In W explorer to avoid deleting the current temp files you sort by date. Trouble is the shift block delete is hampered by the 80 words files in the 144 files of the entire sub-directory. Sorting by date muddles temp and word files indiscrimiantely.

Method 2
So you sort by type. But then the current temp tmp files are muddled up in the mass of temp files, so the block delete will return a can't delete this file warning. Which hampers progress.

With method 1 I accidentally deleted an important Word file the other week. That's why I became interested in an auttoexec solution.

I do have zip backups but they're at least 2 weeks old. So i'm now using a backup version for that lost file.

Tks to everyone who's contributed up till now.
What a great board this is, especially the reminders you get per email.

andrew


http://www.PCGuide.com/ubb/wink.gif

tjaymadison
05-31-2001, 09:50 AM
Rather than use the autoexec.bat file, you could automate the process
with a separate batch file you create and then run yourself.

This way you can decide when it runs, rather than be committed to
run it every time you have to restart.

For example:

cd \correct folder here
del *.tmp



------------------
"I am not able to rightly apprehend the kind of confusion of ideas that could provoke such a question."
-- Charles Babbage, mathematician, computer pioneer, analytical engine designer (1791-1871)
-- (Question: 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?')

"Just because I don't care, doesn't mean I don't understand."
-- Homer Simpson

andrbea
05-31-2001, 11:36 AM
Tks tjay
so not using the autoexec route, I've done this:


i've created a shortcut on the desktop
if i click on it
it throws up a notepad screen
that reads

c:
cd \winword\*
del *.tmp
exit

it's been saved as a textfile called me.bat

what do I have to do to make it execute itself, instead of flashing up the file contents?

and does it need some kind of goto to get it to look through all the subdirectories of winword or will it reiterate by itself?

Tks,

Andrew
http://www.PCGuide.com/ubb/rolleyes.gif

tjaymadison
05-31-2001, 12:20 PM
The statement cd \winword\* will not work as is.

You can use '%', replaceable parameters, and labels, etc., but that seems
like overkill in this instance. All the temp files should be in the same
folder, unless you have created some more intricate subdirectory structure.

When you create the batch file, I would use Notepad, a pure ASCII editor,
rather than WordPad, which is really a word processor. Then you don't get
any extraneous or formatting characters.

@ echo off optional -- suppresses output
cd \winword\name of temp files folder
del *.tmp
exit this line may not be necessary -- you can try both ways
be sure to use a carriage return after the last line.

Save as: DeleteWordTemps.bat or something similar.
Save to: Desktop.

Bat files are executable by default, so all you have to do
to run it is double-click it. If it leaves you in a
DOS window, you will need the 'exit' statement above.


------------------
"I am not able to rightly apprehend the kind of confusion of ideas that could provoke such a question."
-- Charles Babbage, mathematician, computer pioneer, analytical engine designer (1791-1871)
-- (Question: 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?')

"Just because I don't care, doesn't mean I don't understand."
-- Homer Simpson

mjc
05-31-2001, 12:29 PM
The problem with it not running may be that its actual name isme.bat.txt, look at its icon, if it shows the .txt icon then that is what is wrong. Try renaming it to me.bat by right clicking on the icon and selecting rename, and then typing me.bat in the box.


------------------
mjc
Links list:Computer Links (http://www.fortunecity.com/skyscraper/highrise/11/index.htm)

Celts are the men that heaven made mad, For all their battles are merry and their songs are all sad.

andrbea
05-31-2001, 01:58 PM
The batch file runs ok as a bat file from the desktop shortcut.


what it doesn't do is find the tmp files in my 2 chosen subdirectories, eg. the word subdirectory 05.01, the other subdirectory is called "pool99"

The reason (probably) is that they are "hidden" files.
if you do a dir /w on the subdirectory in dos, they don't show.
Conversely, in word97, if you do open file (in that subdirectory) you see all the ~wrl****.tmp files listed.

so how do I get hold of them in dos? (in order to strangle them).
here's the batch file:

cd ..
cd ..
DELTREE /y c:\windows\history\*.* > NUL
DELTREE /y c:\windows\tempor~1\*.* > NUL
DELTREE /y c:\windows\temp\*.* > NUL
DELTREE /y c:\windows\cookies\*.* > NUL
DELTREE /y c:\windows\applic~1\micros~1\office\recent\*.* > NUL
DELTREE /y c:\windows\ShellIconCache
if exist del c:\windows\ff*.tmp
if exist del c:\windows\system\advert.dll
cd c:\windows\winword\05.01
dir /ah
DELTREE /y c:\windows\winword\05.01\*.tmp > NUL
cd c:\windows\winword\pool99
dir /ah
DELTREE /y c:\windows\winword\pool99\*.tmp > NUL
exit

Tks
(getting nearer I think)
Andrew
http://www.PCGuide.com/ubb/smile.gif

tjaymadison
06-01-2001, 01:07 AM
Don't remember all the exact syntax nuances, but to me there
seems to be a problem with the two "if exist" statements.

They need an argument, something like

If exist something del ....

Or just eliminate the conditional entirely, and just do the deletion.
You could add the > nul to the end of those two also, if you wanted to.


------------------
"I am not able to rightly apprehend the kind of confusion of ideas that could provoke such a question."
-- Charles Babbage, mathematician, computer pioneer, analytical engine designer (1791-1871)
-- (Question: 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?')

"Just because I don't care, doesn't mean I don't understand."
-- Homer Simpson

andrbea
06-01-2001, 03:54 AM
This deletes the tmp files in word:

@echo off
cd ..
cd ..
DELTREE /y c:\windows\history\*.* > NUL
DELTREE /y c:\windows\tempor~1\*.* > NUL
DELTREE /y c:\windows\temp\*.* > NUL
DELTREE /y c:\windows\cookies\*.* > NUL
DELTREE /y c:\windows\applic~1\micros~1\office\recent\*.* > NUL
DELTREE /y c:\windows\ShellIconCache
if exist del c:\windows\ff*.tmp
if exist del c:\windows\system\advert.dll
cd c:\winword\05.01
attrib -H -R /S
rem dir /ah
DELTREE /y c:\winword\05.01\*.tmp > NUL
cd c:\winword\pool99
attrib -H -R /S
rem dir /ah
DELTREE /y c:\winword\pool99\*.tmp > NUL
exit


the attrib line did the trick
A happy man, tks everyone.

http://www.PCGuide.com/ubb/smile.gif