display executing name of the current running script

54 views Asked by At

I have tried a few methods, one of them being:

 (define (program) (find-system-path 'pref-file))

I have read from the documentation (after attempting the above code) and have noticed it is not what i'd need to use, obviously :) Any ideas?

Would also like to save this information to a variables. VBS example:

script = WScript.ScriptFullName

1

There are 1 answers

0
Throw Away Account On BEST ANSWER
#lang racket

(display "Program name: ")
(displayln (find-system-path 'run-file))

Output (if saved as "test.rkt" and run with the command racket test.rkt):

Program name: test.rkt

From the racket console REPL, (find-system-path 'run-file) will return #<path:racket>. I didn't try it in DrRacket.