Если вы используете Node.js, вы можете использовать модуль fs
.
Я не смог найти время для тестирования решения, но наивный реализация будет выглядеть примерно так:
// Import the fs module
const fs = require('fs');
// Read all files in directory
var files = fs.readDirSync('/path/to/images/folder/');
// Loop through the files and rename each file
files.forEach(path => fs.rename(path, path.replace('#', '.')));