Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Running PowerPoint Viewer from commandline on Windows

I'm running PowerPoint Presentations from my desktop app, which is written in the electron (node.js). I use child_process to run powerpnt.exe with params, and it works fine. I'm looking for similar solution for workstations, where only PowerPoint Viewer is installed. On some machines, pptview.exe was working fine, but this not always works, I need a reliable solution. I tried to find out the full PowerPoint Viewer path in Windows registry, but I'm not sure where should I look for. Maybe someone knows the reliable way to run pptx file from nodejs in PowerPoint Viewer?

like image 648
S.Greczyn Avatar asked Oct 02 '17 17:10

S.Greczyn


1 Answers

The default location for PowerPoint viewer is:

  • 32 bit Windows 7: C:\Program Files\Microsoft Office\Office12\pptview.exe

  • 64 bit Windows 7: C:\Program Files(x86)\Microsoft Office\Office12\pptview.exe

I would start by checking if those files exists. If not you could check the registry. HKEY_CLASSES_ROOT in the registry holds information on which application should open which file. You should find something like HKEY_CLASSES_ROOT\.pptx\.

If all else fails you could try to do a silent installation of PowerPoint viewer in the background. Download the installation file in the background and run it with PowerPointViewer.exe /quiet /passive /norestart. More info here.

like image 191
Knarf Avatar answered Nov 14 '22 23:11

Knarf