WinBatch® Technical Support Forum

All Things WinBatch => WinBatch => Topic started by: mueer01 on September 27, 2013, 03:42:57 AM

Title: How to get the own filename?
Post by: mueer01 on September 27, 2013, 03:42:57 AM
Hello,

is there any parameter/variable that contains the filename of the running .wbt file?
Example:
I have abc.wbt and a shortcut to abc.wbt called xyz.wbt
If I start abc.wbt or the shortcut xyz.wbt, I want to know what was started:
   message("Here is ", variable)

Regards,
Erhard
Title: Re: How to get the own filename?
Post by: kdmoyers on September 27, 2013, 04:14:58 AM
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.
Title: Re: How to get the own filename?
Post by: mueer01 on September 27, 2013, 05:11:07 AM
Hi,

thanks for the answer.

Unfortunately
IntControl (1004, 0, 0, 0, 0)
returns always abc.wbt, even if I started the shortcut xyz.wbt, that points to abc.wbt.

But anyway, I found a workaround. In the Shortcut detail of xyz.xbt I added the parameter "xyz.wbt". Now I just need to check for param0 and param1.
This works fine for me.

Thanks,
Erhard
Title: Re: How to get the own filename?
Post by: DAG_P6 on September 28, 2013, 08:45:55 AM
Erhard,

Quote from: mueer01 on September 27, 2013, 05:11:07 AM
In the Shortcut detail of xyz.xbt I added the parameter "xyz.wbt". Now I just need to check for param0 and param1.
This works fine for me.

Your imaginative solution is one of the reasons that this board stands out among technical support boards.

Thanks for brightening my day. ;D