Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 761
  • Last Modified:

Rename file =Computer name

I want to rename a file in a comand line script  that renames an existing file to the computer's name.
Example change sourcefile.dat to Lap1.dat if that computer is named Lap1.

Thanks
0
kiald
Asked:
kiald
1 Solution
 
sirbountyCommented:
ren sourcefile.dat %computername%.dat

should do it...
0

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now