1

I am trying to have a batch file run once when Office is started. I opened the following key and inserted it in there but I am obviously not invoking the right command.

HKCU\Software\Microsoft\Office\15.0\FirstRun

I am inserting the item as C:\program files\Office2013Templates\OfficeTemplate3.bat which will run manually but not run from the registry key.

so the entire string looks like this:
"msofficeTemplate"="C:\\program files\\office2013templates\\officetemplate3.bat

I would also like to run it silent, but one thing at a time.

Thanks for any help you might be able to give me.

SomethingDark
  • 13,229
  • 5
  • 50
  • 55
Jeff Tran
  • 33
  • 3

1 Answers1

0

If office is using CreateProcess it won't work because it's not a program. CMD.EXE runs batchfiles. So try this command.

C:\Windows\System32\Cmd.exe /c "C:\program files\Office2013Templates\OfficeTemplate3.bat"

Office may require backslashes to be escaped. Registry files require backslashes and quotes to be escaped. But the registry itself doesn't. So enter above in registry editor and export to get properly formatted regfile.

Trigger
  • 681
  • 3
  • 4