Cher
Cher

Reputation: 2947

how to read content of a file in a environment variable in windows command line?

is there an equivalent in Windows Command to the following command in bash :

variable='cat mytextfile'

I found answers on the net, but they use loop or complicated ways... they're is probably a simple way to do it?

Upvotes: 0

Views: 108

Answers (1)

Boby Bobber
Boby Bobber

Reputation: 56

I use the following command, which works for me

set /p myVar=<myFile.txt

Upvotes: 2

Related Questions