'How do I redirect to a variable which contains the location of the output file
This is a very silly and simple thing that I am not sure how to do
I have defined a variable %debugloglocation% in a bat file which contains the location of the file in which I want the output to be written.
SETLOCAL ENABLEDELAYEDEXPANSION
echo Some value that has to be logged > %debugloglocation%
echo Some value that has to be logged > %%debugloglocation%%
echo Some value that has to be logged > "%debugloglocation%"
The above does not work. How should I pass the location so that it is recognized when the command runs.
Solution 1:[1]
input location.bat
@echo off
cls
set "location=path/to/location"
echo we're working with %location%
pause
should output
we're working with path/to/location
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 |
