Skip to main content
3 of 3
(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).

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
THE JOATMON
  • 949
  • 7
  • 14