What is the best way to open a file with its associated application from TCL?

前端 未结 3 1151
太阳男子
太阳男子 2021-01-25 07:49

I have a TCL/TK app on Windows. What is the best way to open a file with its associated program? For example, I am generating a PDF, and I want it to open automatically.

3条回答
  •  轮回少年
    2021-01-25 08:50

    I would write (for Tcl 8.5)

    exec {*}[auto_execok start] "" $filename
    

    (discussion here). That may display a cmd window though.

    If you have an earlier Tcl,

    eval exec [auto_execok start] {""} [list $filename]
    

提交回复
热议问题