Ok in the findstr it should be "reportSearchPath". Its not even carrying out the commands in the for statement. This means that it's not finding that line in the xml document. I don't know why but it works fine for me and I don't see any problem with that code, I suggest you just use the VBS if it's working.
The section that seems to not be working is this: (maybe you have copied it with the line wrap?)
for /F "usebackq tokens=4 delims='" %%I in (`findstr /i "reportSearchPath" "test.xml"`) do (
set output=%%I
goto copy
)
What that should do is perform the task: "
FINDSTR /I "reportSearchPath" "test.xml"", which should output that line in that file.
This is what I see when I do that on the file, could you try it just in a command line and see what it returns?
C:\Users\DeltaSlaya>FINDSTR /I "reportSearchPath" "test.xml"
<reportSearchPath>/content/package[@name='Provider']/report[@name='PRV-INT-001:Provider NCPDP Interface Error Report']</reportSearchPath>
C:\Users\DeltaSlaya>
Try this code just by itself in batch also:
for /F "usebackq tokens=4 delims='" %%I in (`findstr /i "reportSearchPath" "test.xml"`) do (
set output=%%I
)
echo *actual name found:* %output%
pause
For me the above example returns:
C:\Users\DeltaSlaya>for /F "usebackq tokens=4 delims='" %I in (`findstr /i "repo
rtSearchPath" "test.xml"`) do (set output=%I )
C:\Users\DeltaSlaya>(set output=PRV-INT-001:Provider NCPDP Interface Error Repor
t )
C:\Users\DeltaSlaya>echo *actual name found:* PRV-INT-001:Provider NCPDP Interfa
ce Error Report
*actual name found:* PRV-INT-001:Provider NCPDP Interface Error Report
C:\Users\DeltaSlaya>pause
Press any key to continue . . .
Tell me what trying both those commands returns.