View Single Post
Old Sep 3rd, 2004, 2:57 PM   #5
FoCaL
Newbie
 
Join Date: Aug 2004
Location: St. Louis
Posts: 4
Rep Power: 0 FoCaL is on a distinguished road
Send a message via MSN to FoCaL
Ok I found a way for me to get this to work for anyone whos interested.

What I did is make a short script that starts the power point presentation then starts the slide show. Then I made a function that creates a Scheduled Task on that remote computer and sets it to run that script in 3 minutes. The only problems I had were time zone issues, so I had to modify my time by an hour so that it would work.

I have the script I use on the remote computer and the function I call in my main script posted below. Hopfully this may be usefull for some else doing something similar. Any questions or anything please fee free to post and I do what I can to explain or help someone do something simliar.

Function ScheduleTask
strComputer = "copmuternamegoeshere"
Set objService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colTimeZone = objService.ExecQuery("SELECT * FROM Win32_TimeZone")
For Each objTimeZone in colTimeZone
	strBias = objTimeZone.Bias
Next
dtmCurrentDate = Date
dtmTargetDate = Year(dtmCurrentDate)
dtmMonth = Month(dtmCurrentDate)
If Len(dtmMonth) = 1 Then
	dtmMonth = "0" & dtmMonth
End If
dtmTargetDate = dtmTargetDate & dtmMonth
dtmDay = Day(dtmCurrentDate)
If Len(dtmDay) = 1 Then
	dtmDay = "0" & dtmDay
End If
theMin = Minute(Now)
theHour = Hour(Now)
theHour = theHour - 1
theMin = theMin + 3
If theMin > 60 Then
	theMin = theMin - 60
End If
theTime = theHour & theMin & "00"
dtmTargetDate = dtmTargetDate & dtmDay & theTime & ".000000"
dtmTargetDate = dtmTargetDate & cstr(strBias)
Set objNewJob = objService.Get("Win32_ScheduledJob")
objNewJob.Create"C:\FHN\StartPPT.vbs", dtmTargetDate, False, , , , JobID
End Function

Set objShell = WScript.CreateObject("WScript.Shell")
objShell.Run("C:\FHN\current.ppt")
Wscript.Sleep 15000
objShell.SendKeys "{F5}"
Wscript.quit
FoCaL is offline   Reply With Quote