Set application = WScript.CreateObject("PowerPoint.Application")

slideCount = application.ActivePresentation.Slides.Count

If application.SlideShowWindows.Count > 0 Then
	Set slideshow = application.SlideShowWindows.Item(1)
End If

If IsNull(slideshow) Or IsEmpty(slideshow) Then
	Call Err.Raise(60003, , "SlideShow not running")
Else
	If WScript.Arguments.Length > 0 Then
		slideNumber = WScript.Arguments(0)
		If CInt(slideNumber) > CInt(slideCount) Then
			Call Err.Raise(60003, , "Invalid Slide Number")
		Else
			slideshow.View.GotoSlide slideNumber
		End If
	Else
		Call Err.Raise(60003, , "Slide Number not provided")
	End If
End If