运行和关闭后终止文件

Flo*_* M. 1 lotus-notes file delete-file

在我的lotusscripy中我创建了一个外部文件,我在其中"打印"了一些行,我关闭它然后我用Shell函数运行它:

    Open "D:\testF.dsx" For Output As fileNum%
    Print #fileNum%, "line1"
    Print #fileNum%, "line2"
    Print #fileNum%, "line3"
    Close fileNum%
    result = Shell(|path "D:\testF.dsx"|, 1)
Run Code Online (Sandbox Code Playgroud)

shell函数运行正常,它正在运行的文件.

在此之后我就放了

    Kill fileNum% 'which should delete the file
Run Code Online (Sandbox Code Playgroud)

另外,我试图添加

    Sleep 2 'before the Kill statement but I get the same error: Path/file access error.
Run Code Online (Sandbox Code Playgroud)

谢谢你的时间!

  • 我的脚本的另一个替代方法是清除文件中的所有文本=>所以文件将为空.

Per*_*ten 5

Lotusscript kill语句需要文件名而不是文件num.所以这样做:

Kill "D:\testF.dsx"
Run Code Online (Sandbox Code Playgroud)