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

Popular posts from this blog

resizing Telegram inline keyboard -

command line - How can a Python program background itself? -

php - "cURL error 28: Resolving timed out" on Wordpress on Azure App Service on Linux -