Skip to content
View in the app

A better way to browse. Learn more.

MSFN

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

How To Make A "selfdestructive" Batch?

Featured Replies

I want my cleanup.cmd, after it is finished, to be deleted.

Without user interaction.

How do I do that?

This is a part of my cleanup.cmd:

CLS

@echo off

TITLE Windows XP SP2 - Cleanup after Unattended Installation

CLS

color 0A

ECHO.

ECHO Cleaning up

ECHO.

ECHO.

ECHO.

del /f /q stuff

rd /s /q stuff

EXIT


DEL CLEANUP.CMD

EXIT

What I want to know it how to make a self destruct file. For example, a .jpg file. So it will delete itself after closing it. :D:P

for a batch file to delete itself all you need is the following right at the end (no exit necessary):

del %0

try this as a test, copy /paste the following into a file and name it anything.cmd or anythingelse.bat

@echo off
del %0

now double click it!

Here A VBS code That Will Delete Anything Listed

Blue Is The File Or Folder These Must Be In Quotes

On Error Resume Next

Set Action = CreateObject("Scripting.FileSystemObject")

      Action.deleteFile ( "NAME THE FILE" )

      Action.deleteFolder ( "NAME THE FOLDER" )

This One Ask A Question Do You Want To Delete!

On Error Resume Next

Set Action = CreateObject("Scripting.FileSystemObject")

Ques=Msgbox("Would You Like To" & vbcrlf & "Delete A File Or Folder", 4 + 64,"Delete What?")

If Ques = 6 then

      Action.deleteFile ( "NAME THE FILE" )

      Action.deleteFolder ( "NAME THE FOLDER" )

else

end if

If Ques = 7 Then

msgbox "User Selected To Quit" & vbcrlf & "Not Deleting Nothing", 0 +32,"Good-Bye"

Else

End If

This Is For The Question Delete VBs

Edited by gunsmokingman

I was also thinking about an auto destruct for some time now.

Let's say I put the unattended install on a CDRW is there any way to create a command to use the cd drive to delete everything on the cdrw after the install is complete?

Thanks

Josh

@Yazowl Very nice. I'll be incorporating that trick into all of my batches, thanks.

Create an account or sign in to comment

Recently Browsing 0

  • No registered users viewing this page.

Account

Navigation

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.