Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / First Aid / August 2005

Tip: Looking for answers? Try searching our database.

I need a command line in Windows NT

Thread view: 
redgambit - 28 Jun 2005 23:04 GMT
Hello,
I could really use your help.  I have this JAVA program and it needs to
call an outside program.  I used the following code to do so.

boolean OldC = NUFile.fileExists(Acc + "\\Client.c");
   if (OldC == true) {
     //String cmdLine6 =  "\\\\a1\\scripts\\clientconvert.exe";
doesn't work
     String cmdLine6 = "cmd \\\\a1\\scripts\\clientconvert.exe";
     try {
       Process process = Runtime.getRuntime().exec(cmdLine6);

     }
     catch (IOException ioe) {
       System.out.println(ioe);

This code works fine in 98 with with cmdLine6 set as "start command /c
..."
I know java isn't a scripting language but I really need this program
and it to run in a command line.  I actually can't even get a command
prompt, so if I could just get a command line that would help.  I've
been all over the net and can't find anything that works.

Thank you.
Alan Krueger - 29 Jun 2005 01:08 GMT
> Hello,
> I could really use your help.  I have this JAVA program and it needs to
[quoted text clipped - 14 lines]
> This code works fine in 98 with with cmdLine6 set as "start command /c
> ..."

When you say "Windows NT", do you mean NT 4.0 or an NT-derived OS like
Windows 2000, XP, etc.?  I don't believe the Windows NT 4.0 command
shell understood UNC paths.
redgambit - 29 Jun 2005 15:29 GMT
> > Hello,
> > I could really use your help.  I have this JAVA program and it needs to
[quoted text clipped - 18 lines]
> Windows 2000, XP, etc.?  I don't believe the Windows NT 4.0 command
> shell understood UNC paths.

Sorry I mean NT 4.0...would it work on XP?
redgambit - 29 Jun 2005 15:59 GMT
Its weird because I also have this in my program

String cmdLine5 = "\\\\a1\\scripts\\licensesign";
     try {
       Process process = Runtime.getRuntime().exec(cmdLine5);

     }
     catch (IOException ioe) {
       System.out.println(ioe);

and it works fine.  Also if I open the task manager and watch it the
processes CMD shows up on Processes tab but doesn't run and doesn't
show up on the Applications tab like its suppost to.
William Brogden - 29 Jun 2005 16:57 GMT
> Its weird because I also have this in my program
>
[quoted text clipped - 9 lines]
> processes CMD shows up on Processes tab but doesn't run and doesn't
> show up on the Applications tab like its suppost to.

You may have to provide for consuming the Process output streams before
the program will run to completion. See the JavaDocs for Process for
a discussion.

Bill

Signature

Using Opera's revolutionary e-mail client: http://www.opera.com/m2/

Knute Johnson - 29 Jun 2005 17:07 GMT
> Its weird because I also have this in my program
>
[quoted text clipped - 9 lines]
> processes CMD shows up on Processes tab but doesn't run and doesn't
> show up on the Applications tab like its suppost to.

Are you handling STDIN and STDOUT for your command line program?  If not
it can hang.

Signature

Knute Johnson
email s/nospam/knute/

Roedy Green - 29 Aug 2005 08:12 GMT
>      String cmdLine6 = "cmd \\\\a1\\scripts\\clientconvert.exe";
>      try {
>        Process process = Runtime.getRuntime().exec(cmdLine6);

you don't need CMD to exec an exe file.  See
http://mindprod.com/jgloss/exec.html
Signature

Canadian Mind Products, Roedy Green.
http://mindprod.com Again taking new Java programming contracts.



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.