Re: Create .DOC files from .DOT files automatically



The files are always the same. No, I don't want them overwritten. The
end-user will be updating the .doc files in the new folder. Yes, I'd like
the program to exit if the files already exist in the target folder.

Thanks again for all of your help!

"Pegasus (MVP)" <I.can@xxxxxxxxxx> wrote in message
news:%23C4Aj0EoIHA.548@xxxxxxxxxxxxxxxxxxxxxxx
It depends:
- Are they always the same files or do they change?
- Do you want them to be overwritten?
- Do you want the program to exit?

"Linda Aldrich" <linda.aldrich@xxxxxxxxxxxxxxxxxxx> wrote in message
news:%23IgwJGCoIHA.3892@xxxxxxxxxxxxxxxxxxxxxxx
Great! Thank you! It works well, except for...
If the user folder already exists, it still copies the .dot files over
and than gives an error message that the .doc files already exist. Which
leaves us with a copy of the .dot and .doc docs in the target folder.

should I just add the line
del "%target%\%dir%\*.dot"
after the 'rename' line?

"Pegasus (MVP)" <I.can@xxxxxxxxxx> wrote in message
news:OeZXWpBoIHA.2632@xxxxxxxxxxxxxxxxxxxxxxx
Of course batch files still work - they work better than ever!
Try this:
@echo off
set source=d:\Templates
set target=d:\User Files
echo.
set /p dir=Please enter the target directory, e.g. Finance
if "%dir%"=="" goto exit
if not exist "%target%\%dir%" md "%target%\%dir%"
copy /y "%source%\*.dot" "%target%\%dir%"
ren "%target%\%dir%\*.dot" *.doc

:Exit
echo.
echo Press the Space Bar to close this window.
pause > nul


"Linda Aldrich" <linda.aldrich@xxxxxxxxxxxxxxxxxxx> wrote in message
news:uYfi8HBoIHA.264@xxxxxxxxxxxxxxxxxxxxxxx
That worked when I tested it (including opening the renamed document).
Thanks! Do batch files still work from a command prompt or in Explorer
in Windows XP? If so, is there a way to prompt the user to make a
directory in a certain folder structure and than change directories to
the newly created directory before copying the files over?

"Pegasus (MVP)" <I.can@xxxxxxxxxx> wrote in message
news:edt2U7AoIHA.4620@xxxxxxxxxxxxxxxxxxxxxxx

"Linda Aldrich" <linda.aldrich@xxxxxxxxxxxxxxxxxxx> wrote in message
news:uaRHwyAoIHA.3652@xxxxxxxxxxxxxxxxxxxxxxx
We are looking for a way to automatically create .doc files from .dot
files and place them in a new directory in one step. Can anyone
help?

Thanks!

Linda Aldrich

Assuming that .doc files have the same format as .dot files
(which the experts in a Word newsgroup would be able to
comment on), all you need to do is to run these commands
from a Command Prompt:
copy "d:\Templates\*.dot" "d:\My Documents"
ren "d:\My Documents\*.dot" *.doc











.



Relevant Pages

  • Re: Create .DOC files from .DOT files automatically
    ... Do you want the program to exit? ... than gives an error message that the .doc files already exist. ... @echo off ... Do batch files still work from a command prompt or in Explorer ...
    (microsoft.public.windows.file_system)
  • Re: Create .DOC files from .DOT files automatically
    ... @echo off ... set /p dir=Please enter the target directory, ... end-user will be updating the .doc files in the new folder. ... and than gives an error message that the .doc files already exist. ...
    (microsoft.public.windows.file_system)
  • Re: A macro to extract any para that starts a specific word into another document
    ... using Dir means opening ALL the .doc files in the folder and searching ... FileSearch is a very handy tool. ...
    (microsoft.public.word.vba.general)
  • Re: Creating a Large Document using Insert File Link
    ... you were right the outputted files are .doc files named for the ... files inserted by macros that feed the majority of the templates. ... file by date in a network folder. ... all of these individual files into one document w/ page numbers and common ...
    (microsoft.public.word.vba.general)
  • Re: Create .DOC files from .DOT files automatically
    ... than gives an error message that the .doc files already exist. ... us with a copy of the .dot and .doc docs in the target folder. ... @echo off ... Assuming that .doc files have the same format as .dot files ...
    (microsoft.public.windows.file_system)