You are not logged in.
Hello guys,
I have issue using the following code line :
for /f "delims=" %%a in ('MORE /E +%ligneNo2% ^< %File_Repository%') do (
if not defined ligne2 set "ligne2=%%a"
)
The error i'm facing is :
'more' is not recognized as an internal or external command, operable program or batch file.
This error don't appear when I'm using windows 7 professional.
Did someone already faced this kind of error ?
Regards,
Yannick
Offline
To test this issue, open a cmd window and type
more /?
See what happens.
Offline
Try type in a cmd window:
find /?
If you get an error, may be PATH variable is not set'ed the path to system32 folder, then check with this
path
.::{Honguito98}::.
Offline
Hello,
I tried both find /? and more /? and both are giving me information.
My path is the following :
PATH=C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;c:\sapjvm\bin
I'm using my script from the E:\. Do you think the issue could come from this ?
Regards,
Yannick
Offline
Are you using the variable name path in your batch file? It sounds very much like it.
Offline
You can find the all code here.
@echo off
Echo Start send Mail
set File_Repository=%1
set count=0
rem -- Valeur rechercher dans le script
set value1="CUSTOMER_Catalog_PRD [V0-PMADB\PMA] (SQL_SVR) 2005 Loaded Running"
set value2="VENDOR_Catalog_PRD [V0-PMADB\PMA] (SQL_SVR) 2000 Loaded Running"
Rem -- Ligne pour chaque valeur
set ligneNo1=4
set ligneNo2=5
set "ligne1="
set/a ligneNo1-=1
for /f "delims=" %%a in ('more/e +%ligneNo1% ^< %File_Repository%') do (
if not defined ligne1 set "ligne1=%%a"
)
set ligne1bis="%ligne1%"
set "ligne2="
set/a ligneNo2-=1
for /f "delims=" %%a in ('more/e +%ligneNo2% ^< %File_Repository%') do (
if not defined ligne2 set "ligne2=%%a"
)
set ligne2bis="%ligne2%"
if %ligne1bis% == %value1% set /a count+=1
if %ligne2bis% == %value2% set /a count+=1
set BLAT=E:\usr\sap\PMA\Scripts\Outils\
set SENDER=PRD_MDM_Status
set SERVEUR_SMTP=rel
set DEST=yannick.jacq@veolia.com
if not %count% == 2 %BLAT%\blat.exe %File_Repository% -f %SENDER% -server %SERVEUR_SMTP% -to %DEST%
Echo End send mail
pause
Offline
Test this code:
@echo off
set File_Repository=file.txt
(
echo 1
echo 2
echo 3
echo 4
)>%File_Repository%
set ligneNo2=2
set "ligne2="
for /f "delims=" %%a in ('more/e +%ligneNo2% ^< %File_Repository%') do (
if not defined ligne2 set "ligne2=%%a"
)
echo "%ligne2%"
pause
Offline