Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Script to run new version of PowerPoint Slide

Posted on 2014-11-11
3
Medium Priority
?
381 Views
Last Modified: 2014-11-13
We have a Windows 7 box constantly looping a PowerPoint Slide (with macros) onto two 48" televisions via an hdmi splitter/cat6 converter.  We have mapped a shared drive (T) and created a folder called New in that shared drive.  Our clients are constantly wanting to update the slides, so we have asked them to save the version they want as T:/New/screens.ppsm.  We have created the following script to look for an updated version, kill powerpoint and relaunch.  The problem we are having is the script kills the slide and then opens the full version of powerpoint, rather than just the slide.  Here is the script:

sSourcefile = "T:\NEW\screens.ppsm"
sTargetFile = "T:\screens.ppsm"
sPPTViewer  = "C:\Program Files\Microsoft Office 15\root\Office15\POWERPNT.EXE"
DQ = """"

Set oFSO = CreateObject("Scripting.FileSystemObject")
If oFSO.GetFile(sSourceFile).DateLastModified = _
   oFSO.GetFile(sTargetFile).DateLastModified Then WScript.Quit

Set oWshShell = CreateObject("WScript.Shell")
oWshShell.Run "taskkill.exe /f /im powerpnt.exe", 0, True
oFSO.CopyFile sSourceFile, sTargetfile, True
oWshShell.Run DQ & sPPTViewer & DQ & " /F T:\screens.ppsm", 0, False

We have also created a Scheduled Task to run every minute, to start wscript.exe, with the start-in option of C:/Scripts.  That is where the screens.vbs file lives.  The task is running, but it is not prompting the script to run.  Any ideas?

Thanks in advance,
John
BCC
0
Comment
Question by:John Lijoi
3 Comments
 
LVL 65

Accepted Solution

by:
RobSampson earned 2000 total points
ID: 40439096
Hi, the PPTViewer file you are executing is the full Powerpoint product.  You will want to grab the PPTView.exe from a folder where you have published a presentation.

That way, it should "play" the presentation instead of opening it.

The scheduled task should work fine.  You won't be prompted to run the script when you use that, although you will want to check the "run with highest privileges" box to make sure it can kill the task.

Rob.
0
 
LVL 23

Expert Comment

by:JSRWilson
ID: 40439976
You are opening PowerPoint and then opening the ppsm file. If you do this manually you will see it does not open in show mode.

If you add a /s switch in the command line it should (I haven't tested)

Since it's a ppsm file I guess there are macros. The viewer will NOT run macros.
0
 

Author Comment

by:John Lijoi
ID: 40441829
Thank you both.  I was able to get the script to open the slides by changing from powerpnt.exe to pptview.exe.  I was able to get the task to run by changing the User to BuiltIn/Administrator, checking "Run with the highest priviliges" and by adding arguments to keep the logo from popping up and pointing to the folder the script lives in.

The fact that PowerPoint Viewer doesn't support add-ins has forced me to have users remotely restart the machine running the slides after saving a new version.  The remote computer has Read Only privileges, so the networked file can be modified while its running.  We have pasted a shortcut to the .ppsm file in the Startup folder and we have enabled AutoAdminLogin.  The computer restarts, signs itself in and starts the slides.
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

As freelancing is becoming more and more common in the tech industry, certain obstacles are proving to be a challenge to those who are used to more traditional, structured employment. This article is meant to help identify such obstacles and offer a…
A high-level exploration of how our ever-increasing access to information has changed the way we do our jobs.
The viewer will learn how to create two correlated normally distributed random variables in Excel, use a normal distribution to simulate the return on different levels of investment in each of the two funds over a period of ten years, and, create a …
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
Suggested Courses

885 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question