Kinook Software Forum

Go Back   Kinook Software Forum > Visual Build Professional > [VBP] General Discussion
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 04-16-2004, 12:29 AM
pjaquiery pjaquiery is online now
Registered User
 
Join Date: 01-20-2003
Location: Dunedin, New Zealand
Posts: 114
Command line parameters

Is it possible to get the command line parameters that were used when VisBuildCmd.exe was invoked?

Ideally the command line (excluding the executable) would be available as a system macro.
Reply With Quote
  #2  
Old 04-18-2004, 09:30 PM
kinook kinook is online now
Administrator
 
Join Date: 03-06-2001
Location: Colorado
Posts: 6,034
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
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



All times are GMT -5. The time now is 07:41 PM.


Copyright © 1999-2023 Kinook Software, Inc.