Explode (deflate) selected folder

This button will 'deflate' a selected folder. It is like unarchiving an archive and subsequently deleting the archive, but with a folder instead.

Usage:

  1. select a folder with contents
  2. execute this button
  3. everything within the selected folder will be moved into it's parent path (the folder you are in), basically emptying that folder, then it will be deleted
@set ChildPath={filepath$|noterm}
Copy MOVE {$ChildPath}\* TO .\
Delete FILE={$ChildPath} NORECYCLE SKIPNOTEMPTY QUIET
<?xml version="1.0"?>
<button backcol="none" display="both" separate="yes" textcol="none">
	<label>Explode Folder</label>
	<tip>Move all from selected folder into current path, then delete that folder</tip>
	<icon1>#opentoolbar</icon1>
	<function type="normal">
		<instruction>@set ChildPath={filepath$|noterm}</instruction>
		<instruction>Copy MOVE {$ChildPath}\* TO .\</instruction>
		<instruction>Delete FILE={$ChildPath} NORECYCLE SKIPNOTEMPTY QUIET</instruction>
	</function>
</button>
2 Likes

I don't know why, but this simply doesn't work for me. I select a folder with pic, hit the button and....nothing. I apologize for my ignorance, but does Dopus have a logging mechanism so I can see what's (not) happening?

Give this a try:

@nofilenamequoting
@dirsonly
Copy MOVE FILE="{filepath$}*" HERE
Delete FILE="{filepath$}" NORECYCLE SKIPNOTEMPTY QUIET
2 Likes

Could you tell us the full path of the folder, or one, that is similar (with spaces, etc.)?

This worked like a charm. Thanks!

I couldn't get it to work on any folder/subfolder. Here's an example of the last one I tried:

"D:\Tools\SysinternalsSuite\dowloads"

Coming back to this one, is there a particular switch or argument I can use on the button to automatically overwrite existing files? I've attempted to add "MOVEWITHSHIFT" but it doesn't seem to have any effect. I'm still prompted when there's an existing file in the directory being merged.

Thanks!

Yes: WHENEXISTS=replace.

https://www.gpsoft.com.au/help/opus12/index.html#!Documents/Copy.htm

Thank you! I use this button constantly. So "move" is a function of the copy command.