Ok, I've read a bunch of the info in forum posts related to using exec and detecting which version of Windows you're running so you know whether to call cmd.exe or command.com, and also how sometimes when executing a 16-bit program like PkUnzip you can get an error mentioning NTVDM.exe and how your environment is not set up correctly. Here are examples of what I'm talking about:
This problem occurring on Windows Server 2003 isn't mentioned anywhere, and while I wouldn't imagine it being very different from XP or 2000, the solution for Win 2003 wasn't the same as for them, at least according to the code in that second link above. Basically, I first tried to exec PKUNZIP, and then I tried calling exec("command.com", "/c", pathToPKUNZIP...) and that didn't worked, so I changed command.com to cmd.exe and it currently works, though earlier what I had written worked (an exec on PKUNZIP without cmd or command.com) and then it stopped working again (and I don't know what I did--opened and closed a few cmd/command windows manually?). When exec is invoked in Windows, do you think it's more similar to command.com or cmd.exe, or is this even worth me asking? I know this is rambling, but I'm just trying to grasp what's going on so I can ensure this works when it needs to! Does it matter that to begin with, my Java program gets invoked from a Windows .bat file? I assume that means it loads up cmd.exe...
Here is my code that uses the old PKUNZIP to unzip a password-protected file:
I changed the first line to this and it currently works:
However, as I mentioned, before it worked for only a few hours and I have no idea whether anyone changed ANYTHING on that server! Any idea as to what is going on?