-1

I wanted to create Ms Project file via windows cmd in my script.

The problem is to find the proper command in cmd to create a new .mpp file with the blank project already in it (if the empty project wouldn't be created before, it'll fail my further script).

Already tried:

echo Creating mpp file > file.mpp

and

type nul > file.mpp

Both created .mpp file but failed to create a new blank project in them.

phamer
  • 3
  • 1
  • In the script, open the MS Project application, create a new file, save it, then exit the application. – Rachel Hettinger Mar 09 '23 at 19:17
  • Yeah, but it should be done automatically (once a day on the server) so I'll have no contact with this .mpp (I won't be able to create new file). That why I wonder how to create file via command line – phamer Mar 09 '23 at 19:23
  • Instead create one blank one manually in a separate folder and copy it to the location you need it to appear in changing the file name as needed in the copy process each day – Ben Personick Mar 10 '23 at 15:38

1 Answers1

1

Here's a vbscript that will create and save a blank project file.

Dim mspApp
Set mspApp = CreateObject("MSProject.Application")
mspApp.Visible = True

mspApp.FileNew
mspApp.FileSaveAs "BlankProject.mpp"

mspApp.Quit
Rachel Hettinger
  • 7,927
  • 2
  • 21
  • 31