Kinook Software Forum

Go Back   Kinook Software Forum > Visual Build Professional > [VBP] User Tips, Tricks and Samples
Register FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Rating: Thread Rating: 8 votes, 5.00 average. Display Modes
  #1  
Old 04-03-2019, 03:33 PM
deramor deramor is online now
Registered User
 
Join Date: 05-11-2011
Posts: 27
I know this is a really old thread but I was trying to use this wait on a custom exe. The wait step never finds a PID of the exe I provide to it.

At first I thought it was a 32-bit/64-bit thing since I am using the 32-bit version of VBP and a 64-bit exe. I rebuilt the custom exe as a 32-bit binary and it didn't change the behavior.

The output:

Waiting for process(es) '[FindProcesses("COMPUTER", "BuildDoc.exe")]' to exit...
All process(es) already done
4/3/2019 4:27:59 PM: Build successfully completed (elapsed = 00:00:01).

However the process is listed in the Task Manager.
Running the process with application window hidden or not makes no difference.

Any thoughts?
I am running VBP 9.7

Visual Build Professional 9.7
Copyright © 1999-2019 Kinook Software, Inc.
***Redacted***
Windows Version: Windows 7 Professional
Install path: C:\Program Files (x86)\VisBuildPro9
HideConsole.exe version 1.0.0.0
SftPrintPreview_IX86_U_20.dll version 2.04
VisBuildCmd.exe version 9.7.0.4
VisBuildPro.exe version 9.7.0.5
VisBuildAct.dll version 9.7.0.5
VisBuildCore.dll version 9.7.0.4
VisBuildDotNET.dll version 9.7.0.0
VisBuildExt.dll version 9.7.0.4
VisBuildInf.exe version 9.7.0.4
VisBuildMisc.dll version 9.7.0.4
VisBuildMS.dll version 9.7.0.4
VisBuildMS2.dll version 9.7.0.2
VisBuildNet.dll version 9.7.0.4
VisBuildSvr.dll version 9.7.0.5
VisBuildVCS.dll version 9.7.0.4
Reply With Quote
  #2  
Old 04-03-2019, 04:40 PM
kinook kinook is online now
Administrator
 
Join Date: 03-06-2001
Location: Colorado
Posts: 6,027
It's not really a Visual Build question. Paste the following into a text file.

Code:
Function FindProcesses(computer, processName)

	Set objWMIService = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & computer & "\root\cimv2")

	sql = "SELECT * FROM Win32_Process WHERE Name LIKE '" & processName & "'"
	Set colProcesses = objWMIService.ExecQuery(sql)

	If colProcesses.Count = 0 Then
		FindProcess = "0"
	Else
		For Each objProcess in colProcesses
    		FindProcesses = FindProcesses & vbCrLf & objProcess.ProcessID
		Next
	End If
	
End Function

WScript.Echo(FindProcesses("COMPUTER", "builddoc.exe"))
Save as wait.vbs.

Open a Command Prompt to the path where you saved the .vbs file and run

cscript wait.vbs

I did this with cmd.exe instead of builddoc.exe and got a list of process IDs for each running cmd.exe instance.
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 03:58 AM.


Copyright © 1999-2023 Kinook Software, Inc.