Can I determine the filespec of the running script file from within the script?

Post Reply
ozboomer
Posts: 5
Joined: Sat Dec 09, 2023 4:25 am

Can I determine the filespec of the running script file from within the script?

Post by ozboomer »

When running a batch file (.bat) in the command prompt (cmd.exe) in Windoze, I'm able to determine the filespec of the running batch file, viz:-

Code: Select all

e:\tmp>
e:\tmp>cd
E:\tmp

e:\tmp>type test.bat
@echo off
echo filespec: %~dp0%~nx0

e:\tmp>
e:\tmp>test.bat
filespec: E:\tmp\test.bat

e:\tmp>
Is there a way to do something similar in a BasicMaker script?

I have a number of workarounds... but I'd like to have a 'configuration' file that I move around with my .bas file.

Thanks.
Post Reply

Return to “BasicMaker 2021 for Windows”