WinBatch® Technical Support Forum

All Things WinBatch => WinBatch => Topic started by: jmvmla on June 05, 2018, 04:59:18 AM

Title: retrieving running current scriptname
Post by: jmvmla on June 05, 2018, 04:59:18 AM
Hi all,

Making some test to retrieve the current running scriptname, here is what I've found

With a wbt file compiled to exe , I have used the function "winname()" : file extension is "exe"
With a wbt file running with ctrl-F7 in winbatch studiodio , I have used the function "winname()" : file  extension is "wbt"

My question
Starting the wbt file in winbatch studio in debug (F11), the result of "winname()" gives only the string "wbt'
Title: Re: retrieving running current scriptname
Post by: ChuckC on June 05, 2018, 05:57:06 AM
Take a look at the help topic for IntControl 1004:

IntControl 1004
Syntax:
IntControl (1004, 0, 0, 0, 0)



Returns the full path and file name of the current WinBatch program.

If the current WinBatch script is a child program that was called with the Call( ) function, this IntControl will return the name of the main (calling) program.

See Also:
DirScript

Title: Re: retrieving running current scriptname
Post by: jmvmla on June 06, 2018, 05:16:24 AM
 :) yessssss ; exactly what I was looking for
this "intcontrol" is working in all the cases
thx a lot