Skip to content

Instantly share code, notes, and snippets.

@tablacus
Last active February 26, 2024 07:27
Show Gist options
  • Save tablacus/06e984f22ee56810bdf4d14edbc689a3 to your computer and use it in GitHub Desktop.
Save tablacus/06e984f22ee56810bdf4d14edbc689a3 to your computer and use it in GitHub Desktop.
Reane current folder -Tablacus Explorer
const FolderItem = FV.FolderItem;
if (api.GetAttributesOf(FolderItem, SFGAO_CANRENAME)) {
const s = api.GetDisplayNameOf(FolderItem, SHGDN_FOREDITING | SHGDN_INFOLDER);
InputDialog(FolderItem.Path, s, function (r) {
if (/[\\\/:,;\*\?"<>\|]/.test(r)) {
MessageBox(api.LoadString(hShell32, 4109), null, MB_ICONSTOP | MB_OK);
return;
}
if ("string" === typeof r && s != r) {
try {
FolderItem.Name = r;
} catch (e) {
MessageBox((api.LoadString(hShell32, 6020)).replace("%1!ls!", (api.sprintf(99, "0x%x", e.number)).replace("%2!ls!", s), null, MB_ICONSTOP | MB_OK));
}
}
});
}
return S_OK;
@tablacus
Copy link
Author

tablacus commented Feb 4, 2024

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment