Java command line argument containing backslash -


i want run similar following:

java myprogram c:\path\to\my\file 

when , output contents of first argument, outputs:

c:pathtomyfile 

this works, however:

java myprogram "c:\path\to\my\file" 

but want able first command instead of second. how can achieve this?

the \ charecter used "escape" special characters. means tells program ignore them, or not special them. make work use \\ instead of \. escapes \. use

c:\\path\\to\\my\\file 

Comments

Popular posts from this blog

ruby on rails - RuntimeError: Circular dependency detected while autoloading constant - ActiveAdmin.register Role -

c++ - OpenMP unpredictable overhead -

javascript - Wordpress slider, not displayed 100% width -