Hello all!

Is it possible to self-delete a VBS file. For exemple, placing a VBS file in the startup folder, then after running, that file self-delete.

I know it's possible with a cmd file with

del /f /q "%~f0" >nul 2>nul

But is there any similar function with VBS?

Thanks!
0 Comments   [ + ] Show Comments

Comments

Please log in to comment

Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.

Answers

0
Hi wd40,

I wrote you a self-deleting script.[;)]

Unfortunately it deleted itself when I tested it![:@]
Answered 02/07/2006 by: WiseUser
Fourth Degree Brown Belt

Please log in to comment
0
Only kidding... here it is.

Set oFso = CreateObject("Scripting.FileSystemObject") : oFso.DeleteFile Wscript.ScriptFullName, True
Answered 02/07/2006 by: WiseUser
Fourth Degree Brown Belt

Please log in to comment
0
Haha... thanks

Very appreciated!
Answered 02/07/2006 by: wd40
Orange Senior Belt

Please log in to comment
Answer this question or Comment on this question for clarity