I need to pass an '&' character to a script, running from Windows cmd.exe. Do you know how to escape it? Carets are used in cmd.exe for general escaping.
Trial 1
x:\abc>python args.py "hello world!" "" ^& end
args.py
hello world!
^&
end
Trial 2
x:\abc>python args.py "hello world!" "" "&" end
args.py
hello world!
^&
end
args.py
import sys
for i in sys.argv:
print i
I have a C program: a.exe that is printing from argv, it seems to get the arguments correctly
With a.exe
x:\abc>a.exe "hello world!" "" "&" end
or
x:\abc>a.exe "hello world!" "" ^& end
produces
a.exe
hello world!
&
end
What's going on here, any ideas?