Question

I need to create the same word documents basically every day to create reports. I would very much like to automate this using batch-script (or any script will do, really, as long as it also creates folders).

I have a .bat that creates the set of folders I need that looks like so:

@echo off
set /p dname= Enter Directory Name?
md %dname%
md %dname%
md %dname%\docx
md %dname%\xls
md %dname%\ppt

Now I need to copypaste a file to the docx folder that I have in the root folder, called intial.docx. This file needs to be renamed into

Initial_[Incrementing number]_V1_[Title].docx.

And I also need to set file properties of those files, namely Subject and Comments.

How do I do all that?

Was it helpful?

Solution

Well for the copy paste and renaming section, you could use the copy and rename commands:

@echo off
copy "directory\path\filename.docx" "directory\newpath\filename.docx"
rename "directory\newpath\filename.docx">"directory\newpath\newfilename.docx"
pause

That should work, let me know if you have any problems :)

For the properties, I guess you could just enter those into a text document,that's what I do.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top