Skip to main content
(While we are at it.) - yes, I did not bump it (that was by an answer edit!) Used a more direct cross reference (as user names can change at any time).
Source Link

I'd never thought about it until seeing nicael's answernicael's answer, but I kind of like "quoting the file".

test.bat

@echo off
setlocal enableDelayedExpansion
set argument1=!%1!
echo %argument1%>test.txt

file2.bat

@echo off
echo %~1

I'd never thought about it until seeing nicael's answer, but I kind of like "quoting the file".

test.bat

@echo off
setlocal enableDelayedExpansion
set argument1=!%1!
echo %argument1%>test.txt

file2.bat

@echo off
echo %~1

I'd never thought about it until seeing nicael's answer, but I kind of like "quoting the file".

test.bat

@echo off
setlocal enableDelayedExpansion
set argument1=!%1!
echo %argument1%>test.txt

file2.bat

@echo off
echo %~1
Commonmark migration
Source Link

I'd never thought about it until seeing nicael's answer, but I kind of like "quoting the file".

test.bat

@echo off
setlocal enableDelayedExpansion
set argument1=!%1!
echo %argument1%>test.txt

> file2.bat > > > @echo off > echo %~1

file2.bat

@echo off
echo %~1

I'd never thought about it until seeing nicael's answer, but I kind of like "quoting the file".

test.bat

@echo off
setlocal enableDelayedExpansion
set argument1=!%1!
echo %argument1%>test.txt

> file2.bat > > > @echo off > echo %~1

I'd never thought about it until seeing nicael's answer, but I kind of like "quoting the file".

test.bat

@echo off
setlocal enableDelayedExpansion
set argument1=!%1!
echo %argument1%>test.txt

file2.bat

@echo off
echo %~1
Source Link
THE JOATMON
  • 949
  • 7
  • 14

I'd never thought about it until seeing nicael's answer, but I kind of like "quoting the file".

test.bat

@echo off
setlocal enableDelayedExpansion
set argument1=!%1!
echo %argument1%>test.txt

> file2.bat > > > @echo off > echo %~1