Solved How to change the data in xml ?

Lenovo Thinkcentre m92p 2121a2u desktop...
June 26, 2014 at 01:57:58
Specs: Windows 7, 4 GB
The data in my xml is like this
<TimeStamp Year = "2014" Month = "6" Day = "17" Hour = "11" Minute = "49" Second = "40"/>
I want to change the TimeStamp in many xml's . How should i do this from batch ?

See More: How to change the data in xml ?

Report •

June 26, 2014 at 04:53:40
Seems like the original time stamp would be important...

you might be better off using vbs..or something saner..


Report •

June 26, 2014 at 21:14:43
✔ Best Answer
Batch - mmmmh - maybe, depending. My question: are the values for timestamp target always the same, or changeing, I'm assuming they change. Here is prototype:
::======== begin script: test using 'sanvy.xml'. Output will be sanvy1.xml
@echo off & setlocal enabledelayedexpansion
(for /f "tokens=*" %%a in (sanvy.xml) do (
echo "%%a" | find /i "<timestamp">nul&&echo ^<timestamp year="9999" month="99" day="99" hour="99" minute="99" second="99"/^>||echo %%a
::======== end
make backups of all files. send output to another location (subdir).

message edited by nbrane

Report •

Related Solutions

Ask Question