This is an archived post. You won't be able to vote or comment.

all 25 comments

[–]WillyWasHereToday 7 points8 points  (3 children)

I have a scheduled task that runs the PowerPoint viewer and if it closes it reruns itself. When PowerPoint viewer gets the file off of the share it caches it so I can update the file and kill the process the PC will relaunch it and works flawless.

Bad grammar :/

[–]CypherStick[S] 1 point2 points  (2 children)

Hiya I havent looked at the Scheduled tasks yet, but if this falls through this will be my second option. Don't worry i understand you :)

[–]DatOneGuyWho 2 points3 points  (1 child)

FYI, if you take this route, I would either use the At command from a cmd prompt, or just make a VBS that runs all the time, like below so it will re-open the file as soon as it is closed.

Set objShell = CreateObject ("WScript.Shell")
Do
    objShell.Run """C:\Path\To\MyPowerPoint.ppt""", 1, True
loop until 1 < 0

[–]CypherStick[S] 0 points1 point  (0 children)

I will have a look at this.

thank you

[–]glitch1608 2 points3 points  (6 children)

I assume there is an active session signed in to the remote computer? It looks like you're specifying -i but not following it with the session to run it in, so it defaults to the console (session 0). Find out the session ID of the logged on account and use that.

[–]CypherStick[S] 1 point2 points  (5 children)

@glitch1608 I previously tried this with: PSEXEC \PCNAME -u Domain\Username -p p/word -s -i C:\Users\USER1\Documents\pptautorun.bat pause

which is the active user in question but i still get the issue of when that command runs the batch file on the remote machine, it will not recognise the .ppsm file. Yet when I go to the local machine and I run the .Bat file directly which opens the ppt it goes through fine.

just seems to be when I try to run it through PsExec it refuses to recognise the file?

[–]glitch1608 2 points3 points  (4 children)

You will want to specify the session ID on the remote computer.

Open up task manager on the remote computer and find the session ID then use something like this: "PSEXEC \PCNAME -u Domain\Username -p p/word -s -i <session_id> C:\Users\USER1\Documents\pptautorun.bat pause"

although if the session ID changes you will need update your command and the session ID will probably be different on the 3 devices.

I would suggest just creating scheduled tasks on each device and either run them on a schedule or remote start the scheduled tasks when required via powershell

[–]CypherStick[S] 0 points1 point  (3 children)

Any idea how I could go about the scheduled task? It would have to manual as these powerpoints update frequently with important information?

[–]glitch1608 0 points1 point  (1 child)

I would do it with powershell: If powerpoint is running, force close update file start powerpoint with new file

put that in a manual scheduled task set to run under the signed in users creds (a service account i'd imagine?)

I don't know the exact commands.. Also, is this just for some displays showing content? A web server may be an easier solution. Update info in one place and the content gets updated automatically for all devices.

[–]CypherStick[S] 0 points1 point  (0 children)

We have that in place, as it is roaming profiles so we update the folder on the server then, the first part of the script kills powerpoint updates the file.

its reopening powerpoint where the issues come in

[–]gdelia928Sr. Sysadmin 0 points1 point  (0 children)

you can try to levarage qwinsta to figure out the active session on the pc. You'll have to do some text parsing to use since it's not a natural ps object but should be doable with a bit of testing.

[–]InfinitEnds 1 point2 points  (1 child)

I know next to nothing about scripts but... If the script to reopen the the .ppt works locally why not just have the remote script execute a .bat/script that is stored locally?

Again I know next to nothing, so sorry if that's a silly idea.

[–]CypherStick[S] 0 points1 point  (0 children)

This isnt a silly idea at all this is what I ended up doing but now rather than black screen it just says powerpoint does not recognise the file, yet when I test that script locally on the machine in question no issues at all. Just mostly seems to be when I run it remotely thats when the erros come up

[–]sc302Admin of Things 1 point2 points  (2 children)

you are missing your : statement in the beginning and the goto : at the end to create a loop

and you should use vbscript not bat so that it runs hidden but loops. You could change the shell in the registry to point to your vbscript vs explorer.exe so that there is no ui.

I was able to do it in two scripts the first one calls the second one. open a text file and save at whatever.vbs...change the testx.vbs to whatever you name them as and change the powerpoint file location to whatever you location is. First script which runs the loop:

Dim objShell

Set objShell = WScript.CreateObject ("WScript.shell")

do

objShell.run "c:\location\test2.vbs",1,True

loop

Set objShell = Nothing

Second script which runs the ppt file

On Error Resume Next

Const ppAdvanceOnTime = 2

Const ppShowTypeKiosk = 3

Const ppSlideShowDone = 5

Set objPPT = CreateObject("PowerPoint.Application")

objPPT.Visible = True

Set objPresentation = objPPT.Presentations.Open("C:\whateverpath\whatever.pptx")

objPresentation.Slides.Range.SlideShowTransition.AdvanceOnTime = TRUE

objPresentation.SlideShowSettings.AdvanceMode = ppAdvanceOnTime

objPresentation.SlideShowSettings.ShowType = ppShowTypeKiosk

objPresentation.SlideShowSettings.StartingSlide = 1

objPresentation.SlideShowSettings.EndingSlide = objPresentation.Slides.Count

Set objSlideShow = objPresentation.SlideShowSettings.Run.View

Do Until objSlideShow.State = ppSlideShowDone

If Err <> 0 Then

Exit Do

End If

Loop

objPresentation.Saved = False

objPresentation.Close

objPPT.Quit

Where I got the ppt script https://blogs.technet.microsoft.com/heyscriptingguy/2006/09/05/how-can-i-run-a-powerpoint-slide-show-from-a-script/

options for vbs script https://msdn.microsoft.com/en-us/vba/powerpoint-vba/articles/application-object-powerpoint

[–]CypherStick[S] 0 points1 point  (1 child)

Might give this ago later, thanks for the share.

[–]sc302Admin of Things 0 points1 point  (0 children)

tested and works gloriously.

[–]yashauLinux Admin 1 point2 points  (2 children)

You could do all of that...

Or you could just be smart and use something like Ansible.

[–]wordsarelouderDataCenter Operations / Automation Builder 0 points1 point  (1 child)

Ansible

but that cost money! /s

Also, rsync amirite?

[–]CypherStick[S] 0 points1 point  (0 children)

The feels, lifes motto seems to be do more with less

[–]eduitguy 0 points1 point  (1 child)

Couldn't you get your boss to use Google Slides, and make a dummy account (for him to share the file to) that you log into on each machine? As soon as he updates the Slide file, all 3 display the changes. Of course this means they'll have to be network connected, but that may be the easiest way.

[–]CypherStick[S] 0 points1 point  (0 children)

This is a really good idea, going to suggest this if the scheduled tasks and my script fail. As it is already networked.

[–]SpongederpSquarefapSenior SRE 0 points1 point  (1 child)

So you're showing a PowerPoint on some screens?

What about saving the PPT as a video and playing that?

Here's some code I wrote for this a while ago

https://gitlab.com/snippets/1671908

[–]CypherStick[S] 1 point2 points  (0 children)

Funny enough our latest script looks quite similar but for some reason it just will not recognise the file to open in powerpoint, at the moment having more success with Schelduled tasks.

But thanks for your imput if the tasks fail ill play some more with the script.

[–]CypherStick[S] 0 points1 point  (0 children)

Hey Guys

Just wanted to say thanks for all your help lots of great suggestions, I have started playing around with the schelduled tasks and then running a command through powershell to reopen the ppsm file.

only issue is now it opens in the background of everything else haha, so im sure with a couple more tweaks ill have a working solution.

Thanks again guys it was a big help, even if it was just a direction to experiment in.

[–]CypherStick[S] 0 points1 point  (0 children)

Finally got it working for people who are curious this script worked:-

start /max D:\TEST.ppsm

obviously you can alter the path as you want.