aspose file tools*
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


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Series of commands" Watch "Series of commands" New topic
Author

Series of commands

pjain jose
Greenhorn

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: cmd_12345.sh 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 command_12345.sh 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
Marshal

Joined: Jul 08, 2003
Posts: 24166
    
  30

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 command_12345.sh, 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]
 
Consider Paul's rocket mass heater.
 
subject: Series of commands
 
Similar Threads
Running Unix commands
reply from Jeroen Wenting
What are the steps of using System API for runing a commands on windows and AS/400
Series of commands
how to create a .sh file to execute a series of commands