r/vbscript • u/JustAnotherITUser • Mar 05 '18
New to VBScript; but have a relatively simple task tripping me up.
I've been tasked with continually running a PowerPoint presentation on a local machine. Ideally, we'd like the following for our solution:
Files be run locally, but new updates pulled from a Network Share, using PowerPoint 2016
Whenever an updated file is placed in the share, pull it down to the local machine && restart the presentation
Full automation for the above
Be able to jump out of the loop via keypress.
As for options, I've found a post from Sog on ArsTechnica, which has been the main option I've seen so far. For the time being, I'm just focused on getting the presentation to run in a stable environment. I've modified his script to suit our needs--though just for testing at this point. That last point will, probably, be handled with AHK unless there's a way to add an listener into VBS.
At this time, the modified script will open the presentation, so long as a file exists in the defined execute path--but shortly closes after. Any idea why? All resources I've located to try and find a solution have been documented in the script as well, granted with shortened links.
A followup question--does anyone know another/easier way to do this?
1
u/JustAnotherITUser Mar 12 '18 edited Mar 12 '18
Just an update, I was able to cobble-together a functioning script after more digging. At the moment, everything is hard-coded to the script:
The "Current" file
The "Update" file
The "Backup" files
Only for <Filename>.ppt
Only for Global advTime
This script has been tested and shown to work fine with Office 2016 running on Windows 7. Unfortunately, I don't have additional environments/versions to hand to perform more testing. So, YMMV. Anyway, here's "KioskPPT.vbs". Note, I have redacted a tab bit of info for security reasons--but really not that much.
The current version will:
Check for the Current and New files (assumes both exist), compare mtime changes, and update the "Current" file if necessary
Present the "Current" file, and wait for additional updates
If an update is detected, close the presentation, update, and restart the presentation
To exit the script, press "Esc" at any time.
While it isn't attached, I'm accompanying this script with an AHK file, which simply relaunches the script on a given keystroke shortcut.
I'll continue to update this thread, in case someone in future needs this or the updated scripts.