package com.telnet;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintStream;
import java.io.UnsupportedEncodingException;
import java.net.SocketException;
import org.apache.commons.net.telnet.TelnetClient;
public class WindowsShell {
private TelnetClient telnet = new TelnetClient("VT220");
InputStream in;
PrintStream out;
String prompt = ">";
public WindowsShell(String ip, int port, String user, String password) {
try {
telnet.connect(ip, port);
in = telnet.getInputStream();
out = new PrintStream(telnet.getOutputStream());
login(user, password);
} catch (SocketException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
/