That's to less on informations, please provide more details.
Which scripting language, how does your current script look like and whats's the timestamp format in the file name?
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
I am unable to get the time stamp in file name by using batch script in Windows Server 2022 Datacenter 64-bit Version 21H2(Build 20348.1487). Could you please help me on this.
That's to less on informations, please provide more details.
Which scripting language, how does your current script look like and whats's the timestamp format in the file name?
Hello,
In CMD batch files generally the solution is quite simple — we should use the %date% and %time% built-in variables, that display date and time based on the regional coding. for date echo %date% for time echo %time% just add in front of output file name in connect script for example - "D:\path\outfile_%date%%time%"
--If the reply is helpful, please Upvote and Accept as answer--
Are you trying to rename a file by adding its creation date to the existing file name? If so, something like this will work:
$x = get-item C:\junk\dp.txt
$date = get-date $x.CreationTime -Format "yyyy MM dd"
$x | Rename-Item -Name ("{0}_{1}" -f $date, $x.Name)