Do you mean like this?
@echo off
for /f "delims==" %%A in (' type "c:\test.txt" ') do (
set variable=%%A
)
echo the value is %variable%
I can try this ?
@echo off & setlocal ENABLEEXTENSIONS
set "first="
for /f "delims=" %%a in ('more ^< numbers.txt') do (
if not defined first set first=%%a
)
echo/%first%
in my case :
@echo off & setlocal ENABLEEXTENSIONS
set "first="
for /f "delims=" %%a in ('more ^< Y:\GABINETE/PROYECTOS/MODELOS/CONTROL\MiControl.txt') do (
if not defined first set first=%%a
)
echo/%first%
The value will be the value of varexpediente, because is the first line in the MiControl.txt
I suppose the variable is %first%
How can I do the bat for launch word and open by a predefined bookmark ?
I suppose ..... :
entrarenworddeposicionvariableporunmarc
ador.bat
@echo off & setlocal ENABLEEXTENSIONS
set "first="
for /f "delims=" %%a in ('more ^< Y:\GABINETE/PROYECTOS/MODELOS/CONTROL\MiControl.txt') do (
if not defined first set first=%%a
)
rem "%programfiles%\Microsoft Office\Office10\WINWORD.EXE" /t "Y:\GABINETE\PROYECTOS\%varexpediente%\%varexpediente%.Proyecto.doc" /mmacro3
"%programfiles%\Microsoft Office\Office10\WINWORD.EXE" /t "Y:\GABINETE\PROYECTOS\%first%\%first%.Proyecto.doc" /mmacro3
Note : Really I am made a mess with the actualization of the variable varexpediente, because now i don't get actualize the value. I am going to close the session and retry...