StackOverFlowメンバーの皆様、
このバッチファイルを手伝ってください。「SET/PINPUT =%=%」の回答を使用して、別のバッチファイルを永続的に更新してもらいたいと思います。
これは、ユーザーから回答を得るために実行される最初のバッチファイルです。
@echo off
cls
echo.
echo .................................................................
echo ..... Specify what the name of the Store is, this will send .....
echo ............... alerts to abd@abc.co.za ..............
echo .................................................................
echo.
pause
:option
cls
color 5E
echo.
echo "............ Press 1 to specify what the store name is......"
echo "............ Press 2 to exit the program ................."
echo.
SET /P M=Type from the menu above 1 or 2 then press ENTER:
IF %M%==1 GOTO SEND
IF %M%==2 GOTO EOF
:SEND
cls
color 0A
set INPUT=
set /P INPUT=Enter Store Name: %=%
if "%INPUT%"=="" goto input
echo "You said that the store name is: %INPUT%"
:: Have the user confirm his/her choice
SET /P ANSWER=Is the name correct (Y/N)?
echo You chose: %ANSWER%
if /i {%ANSWER%}=={y} (goto :yes)
if /i {%ANSWER%}=={yes} (goto :yes)
goto :no
:yes
echo You pressed YES!... The name is updating
goto name
:no
echo You pressed NO!... The program will exit
pause
cls
goto eof
:name
::set /A store=%INPUT%
echo %INPUT% >> notify_support.bat
::Terminate the program
:EOF
ご覧のとおり、「echo%INPUT%>>notify_support.bat」の場所を指定するのに苦労しています。これは、2番目のバッチファイルから取得したコードです
@echo off
call senditquiet -s smtp.gmail.com -port 587 -u rsupp0rt@gmail.com -protocol ssl -p access -f rsupp0rt@gmail.com -t 888@gmail.com -subject "Store ABC" -body "Hello there, There is an issue logged at the store.<br>Best regards."
最初のバッチファイルが実行されると、2番目のバッチファイルが更新されますが、ファイルの最後にダンプされます。
2番目のバッチファイルの「StoreABC」を置き換えるには、INPUTECHOedが必要です。
助けてください、私はバッチファイルでかなり錆びています。