Quantcast
Channel: Windows PowerShell forum
Viewing all articles
Browse latest Browse all 21975

How can I rename files and append datetime?

$
0
0
Hi, 
I need rename many files append _datetime (20170124_145010) before their extension and move them to another directory. How can I do it?
I would like to run it within a stored procedure.

Ex:  Source is:
dir c:\source
abc.txt
bcde.txt
cdf.txt
1234_1.txt
bcde_2.txt

Destination is:
dir c:\dest
abc_20170124_145010.txt
bcde_20170124_145010.txt
cdf_20170124_145010.txt
1234_1_20170124_145010.txt
bcde_2_20170124_145010.txt

Tks


Viewing all articles
Browse latest Browse all 21975

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>