Page 1 of 2 12>
Topic Options
#161302 - 2006-04-27 02:24 PM Calling a pps presentation
habeebs Offline
Lurker

Registered: 2006-04-27
Posts: 4
Helo,

I have a problem while I try to call a pps presentation on my script login.

I tried, CALL, SHELL (plus call), RUN, DISPLAY and PLAY.
But the results were not good.

Could, please, someone help me in how call a pps presentation on kix script?

Thanks

Top
#161303 - 2006-04-27 02:55 PM Re: Calling a pps presentation
Mart Moderator Offline
KiX Supporter
*****

Registered: 2002-03-27
Posts: 4672
Loc: The Netherlands
This work for me.

Code:

$key = "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\powerpnt.exe"
$path = ReadValue($key, "Path")

Run $path + "powerpnt.exe c:\file.ppt"



[edit]
I used a .ppt but a .pps also works.
[/edit]


Edited by Mart (2006-04-27 02:57 PM)
_________________________
Mart

- Chuck Norris once sold ebay to ebay on ebay.

Top
#161304 - 2006-04-27 03:56 PM Re: Calling a pps presentation
Radimus Moderator Offline
Moderator
*****

Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
run '%comspec% /c start '+ $pptfile
_________________________
How to ask questions the smart way <-----------> Before you ask

Top
#161305 - 2006-04-27 04:27 PM Re: Calling a pps presentation
ChristopheM Offline
Hey THIS is FUN
*****

Registered: 2002-05-13
Posts: 309
Loc: STRASBOURG, France
take care to long file name.

I use to write
run '%comspec% /c start "'+ $pptfile +'"'
_________________________
Christophe

Top
#161306 - 2006-04-27 04:37 PM Re: Calling a pps presentation
Richard H. Administrator Offline
Administrator
*****

Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
The run/start method doesn't always work - for example it simply opens a command window for me. The same applies to ".htm" files that are not in my current directory.

If you can identify the application path and explicitly execute it you will find it is a more reliable solution for general deployment.

Top
#161307 - 2006-04-27 05:00 PM Re: Calling a pps presentation
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
Here is a way to do this using COM ...

Code:

Break On

$FILENAME = "e:\Presentation1.ppt"

$PowerPoint = CreateObject("Powerpoint.Application")

$Presentation = $PowerPoint.Presentations.Open($FILENAME,,,0)

$= $Presentation.SlideShowSettings.Run

Exit 0


Top
#161308 - 2006-04-27 05:14 PM Re: Calling a pps presentation
Richard H. Administrator Offline
Administrator
*****

Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
Quote:

Here is a way to do this using COM



Is that synchronous?

Top
#161309 - 2006-04-27 05:16 PM Re: Calling a pps presentation
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
Nope - asynchronous. Prolly could make it sync if required.
Top
#161310 - 2006-04-27 05:21 PM Re: Calling a pps presentation
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
The FileAction() UDF can do it.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#161311 - 2006-04-27 08:18 PM Re: Calling a pps presentation
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
yo, basta's...
what's wrong with:
run 'explorer "' + $file + '"'
_________________________
!

download KiXnet

Top
#161312 - 2006-04-27 09:12 PM Re: Calling a pps presentation
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11623
Loc: CA
Quote:

yo, basta's...
what's wrong with:
run 'explorer "' + $file + '"'




Because we don't live in a perfect World and sometimes other applications mess up or take over the file association.

Top
#161313 - 2006-04-27 09:32 PM Re: Calling a pps presentation
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11623
Loc: CA
I like Shawn's COM method myself, actually shows up as a presentation show instead of just opening PowerPoint like the file call method does.

Here is Mart's code a little different, both work well, but Shawn's does it a bit better (imho)
 
Dim $Msg
Run ReadValue('HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\powerpnt.exe','')+' '+
'\\server01\presentations\WELCOM~1.PPS'
If @ERROR
$Msg = MessageBox('There was an error running the presentation please contact support','No Presentation',16)
EndIf

 

Top
#161314 - 2006-04-27 10:02 PM Re: Calling a pps presentation
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
doc, on the other hand.
someone has default application for viewing some type of files and with your style of code you force them to ms appies instead.
tell me, I'm wrong...
_________________________
!

download KiXnet

Top
#161315 - 2006-04-27 10:45 PM Re: Calling a pps presentation
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11623
Loc: CA
Yes, quite true but in this case it would be highly unlikely that a user was not using PowePoint.

One could do a check on the association as well and see if it was even an associated file and to what application and then decide if you want to allow that application to run or if you're going to force another one.
 

Top
#161316 - 2006-04-28 03:45 AM Re: Calling a pps presentation
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
Hey,

welcome to the wonderful world of KiXtart habeebs
_________________________



Top
#161317 - 2006-04-28 07:15 AM Re: Calling a pps presentation
mole Offline
Getting the hang of it

Registered: 2003-01-01
Posts: 76
Loc: Indian Head, Maryland, USA
So many replies since Christophe's its old news now but I think:

Code:
 
run '%comspec% /c start "'+ $pptfile +'"'



... will open a command window because the Start command wants to interpret the string in the first set of quotes it finds as a title. The following will work:

Code:
 
run '%comspec% /c start '+'"Some PPT Show" '+'"'+$pptfile+'"'



mole
_________________________
mole

Who is John Galt?

Top
#161318 - 2006-04-28 10:28 AM Re: Calling a pps presentation
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11623
Loc: CA
rofl, hehe

Boy we are bored. habeebs has not come back and replied and we're all trying to Golf and otherwise recode a simple task.

Top
#161319 - 2006-04-28 05:37 PM Re: Calling a pps presentation
mole Offline
Getting the hang of it

Registered: 2003-01-01
Posts: 76
Loc: Indian Head, Maryland, USA
Not much else to do while mole listens for his coffee to finish perking in the moring.

mole

PS - I hope the *.ppt file actually runs eventually after all this!
_________________________
mole

Who is John Galt?

Top
#161320 - 2006-04-28 07:24 PM Re: Calling a pps presentation
habeebs Offline
Lurker

Registered: 2006-04-27
Posts: 4
Quote:

I like Shawn's COM method myself, actually shows up as a presentation show instead of just opening PowerPoint like the file call method does.

Here is Mart's code a little different, both work well, but Shawn's does it a bit better (imho)
 
Dim $Msg
Run ReadValue('HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\powerpnt.exe','')+' '+
'\\server01\presentations\WELCOM~1.PPS'
If @ERROR
$Msg = MessageBox('There was an error running the presentation please contact support','No Presentation',16)
EndIf

 




This one worked, BUT, it opened in power point, not a presentation.
I mean, I can edit it if I want after I login

And yes, I am reading the post, but while I test, I can't reply to you =p

Thanks

Top
#161321 - 2006-04-28 08:22 PM Re: Calling a pps presentation
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11623
Loc: CA
Yes, that's what I said. PowerPoint opens with the file association method.
If you use the code from Shawn though it will open correctly as a show.

Dim $FileName, $PowerPoint, $Presentation, $Nul
$FileName = '\\server01\presentations\WELCOM~1.PPS'
$PowerPoint = CreateObject('Powerpoint.Application')
$Presentation = $PowerPoint.Presentations.Open($FileName,,,0)
$Nul = $Presentation.SlideShowSettings.Run
Exit 0

Top
Page 1 of 2 12>


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 507 anonymous users online.
Newest Members
gespanntleuchten, DaveatAdvanced, Paulo_Alves, UsTaaa, xxJJxx
17864 Registered Users

Generated in 0.074 seconds in which 0.025 seconds were spent on a total of 13 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org