Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8929065
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T08:35:35+00:00 2026-06-15T08:35:35+00:00

Dear StackOverFlow Members, Please help me with this batch file. I would like to

  • 0

Dear StackOverFlow Members,

Please help me with this batch file. I would like to use the answer given from the “SET /P INPUT=%=%” and have it update another batch file permanently.

This is the first batch file that runs to get an answer from the user

@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

As you can see I am struggling to specify where I should “echo %INPUT% >> notify_support.bat”. This is code taken from the second batch file

@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." 

When the first batch file runs, it updates the second one but just dumps it at the end of the file.

I need the INPUT ECHOed to replace “Store ABC” in the second batch file.

Please assist, I’m rather rusty with batch files.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T08:35:35+00:00Added an answer on June 15, 2026 at 8:35 am
    echo %INPUT% >> notify_support.bat
    

    That line contains >> which means ‘dump at the end of the file’. You can use a single > to overwrite the existing file contents. That way, you can re-generate the whole file (which is only 2 lines anyway).

    A different solution is to actually parse the exising file and replace that text. You can do that by using for /F ..., which allows you to traverse through the lines of a file. You can then generate a new file, based on the (altered) contents of the existing file. Disadvantage is that this file-parsing method is especially suitable for data files in which each line has the same format with fields and delimiters (like a CSV file). It is less suited for parsing ‘complex’ files like a batch file or program source file.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Dear Friends from Stackoverflow, Please help me with a problem that i'm having when
Dear Stackoverflow members I have a recursive CTE query like this: DECLARE @Level TABLE
Hello dear users of the stackoverflow! I really like the search form on this
Dear members of the Stackoverflow community, We are developing a web application using the
Dear All, please help me since I'm newbie in SQL Server. I have a
Dear friends, I need your help. I need to send .bmp file to another
Dear visitors stackoverflow! I can not solve a simple problem: Body given the background
good day dear php-fans at stackoverflow. i want to use imagegrabscreen — to get
Dear friends,I want to extract text 平均3.6 星 from this code segment excerpted from
Dear Stackoverflow Developers i have to load image as an icon to jmenu from

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.