DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

Alexey has posted 28 posts at DZone. View Full User Profile

Batch File That Uses Notepad To Rename A File From Command Line

05.18.2011
| 4467 views |
  • submit to reddit
        just pass a file name that should be renamed to the script

set temp_file=%TEMP%./rename.txt
echo %1 > %temp_file%
notepad %temp_file%
set /p to= < %temp_file%
ren %1 %to%

This scripts demonstrates, how to get a file content into environment variable and back.