WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

Get EXE Name

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

How to Get the EXE name of WinBatch Program

Keywords:     IntControl(1004,0,0,0,0)

Question:

How do I find out the exe name of the currently running parent program?

Answer:

	a=WinExeName("")
	Message("Parent Program",a)
Or:
	a=IntControl(1004,0,0,0,0)
	Message("Parent Program. Method 2",a)
This tells you the currently running EXE. We cannot determine the EXE that started a currently running EXE.

Related Question:

How can i determine the path and name of a wb compiled exe from within the exe ? dirget() doesn't work when the exe is called from another directory eg.:
	c:\hereiam> q:\apps\public\runme.exe 
dirget() called from within runme.exe would return c:\hereiam. a dirchange() can not be applied, as the working directory should stay as it is.

And what about the path?

Answer:

Your choice of:
myexe=IntControl(1004,0,0,0,0)
mypath=Filepath(myexe)
Message("The path is",mypath)
Or:
mypath=DirHome()
Message("Home Path",mypath)

Article ID:   W13156
Filename:   Get EXE Name and Path of Parent Program.txt
File Created: 1999:04:15:16:52:08
Last Updated: 1999:04:15:16:52:08