windows - bat file not updating the xml file -
i have written bat, 1 below update xml tag, not updating xml file.
@echo off set prefix=room107- set suffix=\admin set /p pcname1=please enter desired number: set pcname=%prefix%%pcname1%%suffix% $ sed 's#\<userid>admin</userid># <userid>%pcname%</userid>#' test.xml
the userid
should updated room107-01\admin
.
by adding -i
, double quotes should work
@echo off set prefix=room107- set suffix=\admin set /p pcname1=please enter desired number: set pcname=%prefix%%pcname1%%suffix% sed -i "s#<userid>admin</userid>#<userid>%pcname%</userid>#" test.xml
Comments
Post a Comment