Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Emergency help needed: Execute an app at the end of a VB script

Status
Not open for further replies.

mkanet

IS-IT--Management
Nov 26, 2011
1
I need to execute an app after the below script needs to quit. I dont know enough about VB script to do that:

I need to execute "C:\Program Files (x86)\Promixis\Girder\60hz.exe"

Here's the script:


Set objArgs = WScript.Arguments
If objArgs.Count < 10 Then
MsgBox "Bad argument count !", MB_OK, "ReClock Event Notification"

' We have done nothing. Return 1 to indicate ReClock that
' the configuration has not changed
WScript.Quit 1
End If

eventName = objArgs(0)
mediaType = objArgs(1)
soundMode = objArgs(2)
currentMonitor = objArgs(3)
totalMonitorCount = objArgs(4)
currentResolution = objArgs(5)
currentRefreshRate = objArgs(6)
originalPlaybackSpeed = objArgs(7)
currentPlaybackSpeed = objArgs(8)
currentMediaFile = objArgs(9)

' If you need to debug, replace false with true in the following line
If false Then
MsgBox _
eventName & " " & _
mediaType & " " & _
soundMode & " " & _
currentMonitor & " " & _
totalMonitorCount & " " & _
currentResolution & " " & _
currentRefreshRate & " " & _
originalPlaybackSpeed & " " & _
currentPlaybackSpeed, _
MB_OK, "ReClock Event Notification"
' WScript.Quit 0
End If

' Here is a sample of what can be done with PowerStrip
Set wshShell = CreateObject("WScript.Shell")

' We will put new timings here if necessary
newTimings = ""

' Obviously we have something to do only if the icon is yellow
If eventName = "YELLOW" Then

' If soundMode = "PCM" Then

' Call the profile that match best what we need in PCM mode
Select Case mediaType
Case "CINEMA"
newTimings = "23"

Case "PAL"
newTimings = "23"

Case "PAL(2x)"
newTimings = "23"

Case "NTSC"
newTimings = "59"

Case "NTSC(2x)"
newTimings = "59"

Case "CINEMA(2x)"
newTimings = "59"

' case "CUSTOM"
' newTimings = currentPlaybackSpeed / 1000

End Select

' End if

End If

' We quit the player, restore our favorite refresh rate and/or resolution
' If eventName = "QUIT" Then

' newTimings = "59"

' End If

If eventName = "STOP" Then

WScript.Quit 1

End If

' Do we have new timings to apply ?
If newTimings <> "" Then

Set objShell = CreateObject("Shell.Application")
Set objFolder = objShell.Namespace(&H26&)
Set objFolderItem = objFolder.Self

' Run SetDisplayFrequency command and wait for it to finish its job
WshShell.Run """" & _
"C:\Program Files (x86)\SlySoft\AnyDVD\SetDisplayFrequency.exe"" " & newTimings, 0, true

' If eventName <> "QUIT" Then
' WScript.Sleep(2000)
' End If

End If

' We have done nothing. Return 1 to indicate ReClock that
' the configuration has not changed
WScript.Quit 1
 
Hi ! Try this :
Code:
Set wshShell = CreateObject("wscript.shell")
command = """C:\Program Files (x86)\Promixis\Girder\60hz.exe"""
Result = wshShell.Run(Command,0,True)
 
In general,you can use this code too to bypass the space in the path like this:
Code:
Set wshShell = CreateObject("wscript.shell")
ProgramFiles = wshShell.ExpandEnvironmentStrings("%programfiles%")
command = ProgramFiles &"\Promixis\Girder\60hz.exe"
Result = wshShell.Run(qq(Command),0,True)

Function qq(strIn)
    qq = Chr(34) & strIn & Chr(34)
End Function
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top