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.

delete on next boot cmd help

Featured Replies

hi

this is what i want to do

A right context menu option to delete a folder ad next reboot

this is what i have sofare:

[HKEY_CLASSES_ROOT\Directory\shell\delete]
@="Delete bij volgende Start"
[HKEY_CLASSES_ROOT\Directory\shell\delete\command]
@="dell.bat \"1%\""

the bat file:

REG ADD "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce" /V Cleanup /D "cmd.exe /C RD *.* /S /Q"

in the bat file, if you use it this way i know i must specify a folder to delete it

the question:

is there a command to use it on all folders, not just 1

question 2:

the same option to delete a file

thanks for reading this

:)


soulin, more details please. :P

sixpack, what I can tell is that %CD% refers to current directory, and %%1 refers to current file. Hoping that hint helps ;)

You can try making your .BAT based on that info. And what do you mean by "all folders" ? Do you mean to say all folders within that folder? If so, use recursive folder removal ("rd /?" for help).

  • Author

@prathapml

with all folders i mean

delete a folder on the desktop

and delete a folder in lets say windows

so delete the folder with every thing in it

do you have a example on how to use the %CD% and %%1

have tryed every command i know and it still doesend work

.reg

[HKEY_CLASSES_ROOT\Folder\Shell\Delete on Reboot\Command]
@="Delfolder.cmd \"%1\""

.cmd

set Dir2Del=%1
REG ADD HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\Currentversion\RunOnce /v DelOnNextReboot /d "cmd.exe /c RD /S /Q %Dir2Del%"

havent tested it but i think it should work

  • Author

well i guess i f***tup the registery

my option delete for folders is gone [the windows one]

glad it's the test pc

edit: fixed

i tested it too, i get "too many commandline parameters" or something like that, it cant figure it out, cuz the directory is set

  • Author

suppose this will work, then you can only delete 1 folder

the code must be for multiepul folders

and must work to on files

my guess is it cant be done

or there must be a dll someware that can do all this

but give up, NEVER

Sorry for late response: about PFR, try to download tools like alter.exe or similar and look to registry changes they made...

- U can add files to copy during boot sequention

- U can add files to delete during boot sequention

- U can delete all pending operation (but I dont recommend this)

PFR is also used for installing hotfixes (e.g. only newest version of files will be copied).

This one works:

DeleteFolderonReboot.reg

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\Folder\shell\Delete on reboot\command]
@="delfolder.cmd \"%1\""

Delfolder.cmd

@echo off
setlocal
set pathwithquotes=%1
set originalpath=%pathwithquotes:~1,-1%
REG ADD HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\Currentversion\RunOnce /v "Del %originalpath% OnNextReboot" /d "cmd.exe /c RD /S /Q  \"%originalpath%\"" /f
endlocal

Delfolder goes into windir or system32.

EDIT: Fixed this with faster code

  • Author
This one works:

Delfolderonnextrebootextension.reg

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\Folder\shell\Delete on reboot\command]
@="CMD.exe /C start /B /wait /D\"%1\" delfolder.cmd"

Delfolder.cmd

@echo off
CMDOW @ /HID
REG ADD HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\Currentversion\RunOnce /v "Del %cd% OnNextReboot" /d "cmd.exe /c RD /S /Q \"%cd%\"" /f
EXIT

Delfolder goes into windir or system32.

BTW, why do you need this feature???

i allway's have files/folders that are in use

to mutch digging around in windows i guess :lol:

i will test it when i get home

thanks for the reply :)

  • Author
reply, it's an reply <_<

well sorry. old dude here

i know my english is bad, sorry for this :}

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.