@echo off SETLOCAL rem How to rename NicePage pages for external and internal rem No naming limits rem Changes the name of .html and .css files rem Changes internal references. rem ************************ How to use this batch file ************************ rem Before using you must update the input area below and download fnr.exe. rem You need fnr.exe to use this batch file: fnr = find and replace. rem Get fnr.exe here: http://findandreplace.io/ rem Use search at bottom left of Windows screen. Search for CMD which is the command prompt rem Navigate to folder with this batch file. Type name of this batch file and hit enter. That's it. rem START: Input area starts here set loc_fnr="C:\Users\Matt\Downloads\fnr\fnr.exe" set loc_data="C:\Users\Matt\Documents\Nicepage Templates\redirect9" rem .css and .html will be added later | Make sure there are no spaces at end of line. set obj[0].find="Change-HTML-Title" set obj[0].replace="how-to-automatically-change-nicePage-html-titles" set obj[1].find="Home" set obj[1].replace="turn-average-website-hosting-into-great-website-hosting-h" set obj[2].find="Page-2" set obj[2].replace="lost-in-php-problems-with-centos-cwp" set obj[3].find="Page-3" set obj[3].replace="lost-in-database-problems-with-centos-cwp" set obj[4].find="Page-4" set obj[4].replace="lost-in-mail-problems-with-centos-cwp" set obj[5].find="Page-5" set obj[5].replace="redirection-diy-url-shortener" set obj[6].find="Page-6" set obj[6].replace="fixing-some-centos-web-panel-cwp-problems" set obj[7].find="Page-7" set obj[7].replace="dns-and-mail-issues-on-cent-os-web-panel-cwp" set obj[8].find="Page-8" set obj[8].replace="best-cheap-web-hosting" set obj[9].find="Page-9" set obj[9].replace="migrating-a-word-press-website-to-vps-with-centos-web-panel-cwp" rem len is number of find/replaces you want to do. Or 1+max_index (here: max_index=9). set len=10 rem Add as many as you want. rem STOP: Input area stops here rem ************************ No need to touch anything below this line ************************ rem Current working directory set loc_cd=%cd% rem Remove quotes from string set loc_data_nq=%loc_data:"=%\ rem Change directory chdir %loc_data_nq% set i=0 :loop if %i% equ %len% goto :my_end rem Begin parsing of obj with index i set cur.find= set cur.replace= for /f "usebackq delims==. tokens=1-3" %%j in (`set obj[%i%]`) do ( set cur.%%k=%%l ) rem End parsing of obj with index i rem START: code for doing stuff starts here ::echo find1: %cur.find% replace1: %cur.replace% set cf=%cur.find% set cr=%cur.replace% rem Remove quotes set cf=%cf:"=% set cr=%cr:"=% SET cf_html=%cf%.html SET cr_html=%cr%.html ::echo find2: %cf_html% replace2: %cr_html% SET cf_css=%cf%.css SET cr_css=%cr%.css ::echo find3: %cf_css% replace3: %cr_css% rem Do internal find and replace echo FNR HTML: %cf_html% %cr_html% %loc_fnr% --cl --dir %loc_data% --fileMask "*.html" --excludeFileMask "*.dll *.exe" --includeSubDirectories ^ --find %cf_html% --replace %cr_html% echo FNR CSS: %cf_css% %cr_css% %loc_fnr% --cl --dir %loc_data% --fileMask "*.html" --excludeFileMask "*.dll *.exe" --includeSubDirectories ^ --find %cf_css% --replace %cr_css% rem Rename the files ren %cf_html% %cr_html% ren %cf_css% %cr_css% rem STOP: code for doing stuff stops here set /a i=%i%+1 goto loop :my_end rem Back to original directory. chdir %loc_cd% ENDLOCAL :: starting source: helloacm.com batch programming tutorials :: create arrays in batch