View Single Post
  #12 (permalink)  
Old 07-02-2008, 03:35 AM
scotter59 scotter59 is offline
Member
 
Join Date: Jul 2008
Posts: 12
scotter59 is on a distinguished road
Quote:
Originally Posted by nhabibi View Post
Hi all,

I want to get a list of a directory with dir command (windows Vista). I write:

Runtime.getRuntime.exec("cmd.exe /C dir " + MyPath);

but the command can't find the specified path for dir. My question is that how we can pass an argument for command line's programs like dir, copy,etc?

Might need to have something like this ("cmd.exe /C dir """ + MyPath + """") had a similar issue with vbscript today, damn """" and spaces. This may not be exact but might help with your problem.
Reply With Quote