File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Java in General and the fly likes Series of commands Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "Series of commands" Watch "Series of commands" New topic

Series of commands

pjain jose

Joined: Mar 31, 2004
Posts: 5
I have a Java Socket Programming Server side and Client side. its works on my PC.
my server works on the methods like ... my PC OS -Windows NT - i started my java server from my machine. i have another unix machine,use only its ip and port .then i tried to run on javaserver ip,port of unix. i could run this way..

c:\>javaserver ip ,port -- [server runs this ip,port of unix]
server starting....
c:\>javaClient ip port -- [client runs on unix ip ,port its messages as follows]
[-- here typed unix command and then this time server automatically create a temp ile on usr/tmp directory. eg: and stored
all commands from the client.]
Enter command :ls
Enter command :cal
Enter command :N -- flag N means sending commands user wants stop.

[if the client sent the commands stop signal to server eg: i mentioned "N" - means (flag) end of command,(client can send n number of commands to send to server). this time server accept N then start to executing commands one by one from file and its result stored in to the command_12345.txt file, then after sent the result to the client.]
i could run on all the commands on UNix from windows platform.

In the above methods i can't run windows NT commands, AS400 commands and AIX commands.This is my requirements.
How to solve this problem on my Programme.
Thanks in advance
Ernest Friedman-Hill
author and iconoclast

Joined: Jul 08, 2003
Posts: 24199

If I understand you correctly (and I'm not at all sure I do) you've written a program which listens on a socket for strings from a client, saves the strings into a file named, and runs this as a script. It works correctly on UNIX, but not on Windows NT.
Well, the main problem may just be that Windows NT doesn't use shell scripts, it uses batch files named *.bat. Unless the file has a name like this, Windows won't execute it. Otherwise the basic approach is going to be similar.
You do realize that this is an incredibly dangerous program, right? Anyone with access to this network will be able to completely take over the machine.

[Jess in Action][AskingGoodQuestions]
I agree. Here's the link:
subject: Series of commands
It's not a secret anymore!