View Single Post
  #2  
Old 04-18-2004, 09:30 PM
kinook kinook is online now
Administrator
 
Join Date: 03-06-2001
Location: Colorado
Posts: 6,027
You could use WMI to retrieve this (the text below can be copied/pasted into VBP). It will retrieve the entire command-line, including the executable.

<step action='Run Script' type='0'>
<Language>VBScript</Language>
<Script><![CDATA[Builder.LogMessage "VisBuildCmd command-line = '" & GetCommandLine & "'"

' use WMI to retrieve the command-line of the VisBuildCmd.exe
' process on the current machine (assumes only one running instance)
' see http://msdn.microsoft.com/library/en...32_process.asp
' for more details
Function GetCommandLine()

Set objWMIService = GetObject("winmgmts:{impersonationLevel=impersonat e}!\\.\root\cimv2")

Set colProcesses = objWMIService.ExecQuery("Select * from Win32_Process Where Name = 'VisBuildCmd.exe'")

For Each objProcess in colProcesses

GetCommandLine = objProcess.CommandLine
Exit Function
Next

End Function
]]></Script>
<indent type='3'>1</indent>
<name>New Step</name>
</step>
Reply With Quote