rename-files-date-prefix

Renames SharePoint document library files with created-date prefixes after a preview confirmation.

128|50|Updated May 4, 2026
One-click install
npx skills add https://github.com/pnp/sharepoint-skills --skill rename-files-date-prefix-pnp
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: rename-files-date-prefix
Source: https://github.com/pnp/sharepoint-skills/tree/main/Skills/rename-files-date-prefix/rename-files-date-prefix
Command: npx skills add https://github.com/pnp/sharepoint-skills --skill rename-files-date-prefix-pnp

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Document libraries accumulate inconsistently named files that are hard to sort chronologically. This Skill bulk-renames every file in a SharePoint library (including subfolders) to prefix the filename with its created date in yyMMdd format, with a preview step so nothing changes without approval. ## Core Features & Use Cases - Recursive batch renaming: Processes all files in a library and its subfolders using a CAML query filtered to files only, never folders. - Preview-before-commit: Shows a table of current names, proposed new names, folders, and statuses, then renames only after user confirmation. - Collision and idempotency handling: Skips files already prefixed with six digits and a hyphen, skips name collisions instead of overwriting, and is safe to re-run after an interrupted batch. - Use Case: A team inherits a messy project library with hundreds of files. Run the Skill to get "251203-Status Report.pdf" style names across every subfolder, review the preview, and confirm once. ## Quick Start Ask Copilot in SharePoint to prefix all files in this document library with their created date.

Frequently Asked Questions about rename-files-date-prefix

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add a date prefix to all files in a SharePoint library?▼

Invoke the rename-files-date-prefix skill in Copilot in SharePoint and specify the target library, or use the current one. It retrieves all files recursively, shows a preview table of old and new names, and renames only after you confirm.

How to bulk rename files in SharePoint without renaming folders?▼

The skill filters items with a CAML query where FSObjType equals 0, which matches files only. Folders are never renamed, and files in all subfolders are still processed recursively using fetchAll.

Does the rename skill overwrite files with duplicate names?▼

No. If the proposed yyMMdd-prefixed name already exists in the same folder, the file is marked as Skipped (name collision) and left untouched. It never appends numeric suffixes; you resolve the conflict manually.

What happens if the batch rename is interrupted partway through?▼

The skill is safe to re-run from scratch. Files already renamed start with six digits and a hyphen, so the skip check excludes them automatically, and the next run resumes exactly where the failure stopped.

Which date and time zone does the filename prefix use?▼

The prefix uses the file's Created date, not Modified, formatted as yyMMdd. Dates are formatted in the site's regional time zone rather than raw UTC, falling back to UTC with a notice if the site time zone cannot be determined.