Open In App

Batch Script – Create String

Last Updated : 19 Dec, 2021
Improve
Improve
Like Article
Like
Save
Share
Report

In this article, we are going to learn how to create a String using Batch Script.

Batch Script :

@echo off 
set str=Geeks for Geeks
echo %str% 
pause
  • By using ‘ set ‘ we are getting input of any string.
    • Ex: set str=input string
  • In the next line, we are using ‘ echo %str% ‘ for printing our input string.
  • Then we are using ‘pause’ , to hold the screen until any key is pressed, so that we can read our output.

Output :

Output

As we can clearly see that our string is created.


Like Article
Suggest improvement
Previous
Next
Share your thoughts in the comments

Similar Reads