This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
My installation of Windows 7 does not recognize mount. It does recognize mountvol, though. I'd tend to believe Maneesh is right and your system is somewhat crooked; you should start using mountvol perhaps.
The error message you're getting might mean that the cmd.exe executed from Java does not have necessary permissions to run C:\Windows\System32\mount.exe (assuming it does exist at that location, as you report). Aren't you running the console as an Administrator when you're trying that from command line?
Joined: Nov 15, 2010
I got the solution from my friend...It should look like as -
That looks odd. Yes, the entire mount command should be one argument - it's one of two arguments (the other /C) to cmd.exe. It's the first /C and the other cmd.exe I find odd. I think the following should be enough:
I don't think there is any problem with parceling the arguments one way or the other. At the end the arguments in the array get concatenated together with space as a separator under Windows (or so I believe - Windows does not have that sophisticated shell interface as Unix).
However, the need to use sysnative looks highly suspicious. This is a way for a 32bit application to access 64bit version of the system32 directory, which is otherwise unavailable due to redirection. It also means that there is only 64bit version of mount.exe on the system, otherwise this would not be needed and the 32bit application would call mount.exe from 32bit version of system32 directory. This need not be a problem, if the application is to never be run on another system, but if the plans are to use it on other computers, it can run into a new problems of its own. Also, I believe that if run using 64bit JRE, it would fail, as sysnative is not recognized by 64bit apps (see this).