3

As title says, I need to execute cmd command from text file.Let's say I have text file called file and in it it's written Color A.I need something like command: type file.txt and not just write it on screen, but I want it to press enter meanwhile.Batch file options are welcomed too.Thank you.

2 Answers 2

6

You can use save your normal file with batch programming in it with .bat extension. And run that file WhateverNameItIs.bat on your command prompt.

Saved it as file.bat

 @ECHO ON
 ECHO Color A

In your case you can drag file from your where your are to command prompt. Or Using CD you can reach out where your file is saved within your command prompt. Fire up file.bat on your command prompt will execute whatever batch programming is written on that file.

Sign up to request clarification or add additional context in comments.

Comments

2

you can use

xcopy Name.txt (your Folder)
ren Name.txt Name.bat
call Name.bat (or full location of Name.bat)

it should work

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.