Remove-ShellFolder

Use this command to remove a system folder and all files contained in this folder.


Settings:

  • Where to delete
    The target for the system folder to be deleted. The real paths are read at runtime from the registry in the key HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders.
  • Folder
    The name of the folder to be deleted. Variables are allowed.
  • Options
    • Computer-related Link ("All Users")
      Indicates whether it is a computer-related folder that is available to all users of a computer (e.g. in the All Users profile)
    • Delete all subfolders
      If not enabled, the system folder is only deleted if it does not contain any subfolders. If the system folder does not contain any subfolders, it will be deleted (along with the files it contains). Otherwise, the command is not executed.
    • Use 32-Bit mode on x64 computer
      If the script is executed on a 64-bit operating system, the counterpart for 32-bit applications SysWOW64 can be used automatically when referring to the SYSTEM32 directory.


Example:

The example removes the folder "NWC Services GmbH" from the All Users start menu including all subfolders and files or shortcuts.


Corresponds to DSM eScript command:

  • RemoveFolder


See also: