acunaara
asked on
How to rename a file with CMD including the hostname?
Using Batch I want to rename a file as follows
System.txt -> rename to -> system_server1.txt
System.txt -> rename to -> system_server1.txt
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Nice Thanks for your prompt response!!
for /f %%a in ('hostname') do set Hostname=%%a
ren "system.txt" "%hostname%_system.txt"