Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

White space issue in exec command.

 
Gurumurthy Ramamurthy
Ranch Hand
Posts: 273
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am using exec task in ant.

<exec executable="cmd.exe">
<arg line="/C"/>
<arg line="${was.home}\versioninfo.bat"/>
</exec>

During run-time, ${was.home} resolved to c:\was51\Web Sphere\AppServer\bin,

So, I am getting the problem:
[exec] The system cannot find the path specified.

Does this mean I can't have space in the directory names?

thanks,
guru
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Depends on the application you are running. In this instance you could possible get away with adding quotation marks round your command. When I'm working on Windows I tend to use short format directory names everywhere, just as a safe guard.
 
Gurumurthy Ramamurthy
Ranch Hand
Posts: 273
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks man.

Now,I have changed all my arg-line to arg-value like this:
<arg value="${was.home}\versionInfo.bat">

But, again failing with:
running:
[echo] c:\was51\Web Sphere\AppServer\bin
[exec] Current OS is Windows XP
[exec] Executing 'cmd.exe' with arguments:
[exec] '/C'
[exec] 'c:\was51\Web Sphere\AppServer\bin\versionInfo.bat'
[exec]
[exec] The ' characters around the executable and arguments are
[exec] not part of the command.
Execute:Java13CommandLauncher: Executing 'cmd.exe' with arguments:
'/C'
'c:\was51\Web Sphere\AppServer\bin\versionInfo.bat'

The ' characters around the executable and arguments are
not part of the command.
[exec] The system cannot find the path specified.

Thanks,
Guru
 
Carol Enderlin
drifter
Ranch Hand
Posts: 1364
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is this still a problem?

From the output you showed you weren't using either of Paul's suggestions, to use quotes or short names.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic