/build/static/layout/Breadcrumb_cap_w.png

Self Delete VBS File Possible

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

Answers (3)

Posted by: WiseUser 18 years ago
Fourth Degree Brown Belt
0
Hi wd40,

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

Unfortunately it deleted itself when I tested it![:@]
Posted by: WiseUser 18 years ago
Fourth Degree Brown Belt
0
Only kidding... here it is.

Set oFso = CreateObject("Scripting.FileSystemObject") : oFso.DeleteFile Wscript.ScriptFullName, True
Posted by: wd40 18 years ago
Orange Senior Belt
0
Haha... thanks

Very appreciated!
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ