473,508 Members | 2,107 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Perl windows telnet session end

10 New Member
I have written Perl script to automate my work using telnet to connect to windows and start server.

Expand|Select|Wrap|Line Numbers
  1. #!/usr/bin/perl -w
  2. use Net::Telnet;
  3. $telnet = new Net::Telnet ( Timeout=>30, Errmode=>'die');
  4. $telnet->open('ip');
  5. $telnet->waitfor('/login: $/i');
  6. $telnet->print('admin');
  7. $telnet->waitfor('/password: $/i');
  8. $telnet->print('password');
  9. $telnet->waitfor('/\C:\\\\Documents and Settings\\\\Administrator/');
  10. $telnet->print('start server');
  11. $telnet->close();
When the program ends, server again returns back to not running state. In Unix, this works well.

After $telnet->close(); the server went back to old state(not running). I want the server to be running, even the program ends.
Nov 22 '12 #1
0 1611

Sign in to post your reply or Sign up for a free account.

Similar topics

2
3957
by: Christian Wilcox | last post by:
I'm trying to programmatically access information from a telnet session which is normally accessed with a telnet program capable of terminal emulation (currently set at VT320). The initial login...
3
8643
by: Yannick Turgeon | last post by:
Hello all, I'm currently trying to pass commands to a telnet session and get the texte generated (stdin + stdout) by the session. The problem I get is that the Telnet.read_until() function...
1
2339
by: Michael | last post by:
Dear all, Given the following challenge: 1. The application is an exe on a W2K server 2. User logs via telnet to the server 3. After checking the user account and password, a bat file runs...
3
5037
by: michael sorens | last post by:
I have searched extensively and have found only hints of what is needed so far: What I want to do is open a telnet session to a remote host on a given port, login, execute a simple command, and...
2
4556
by: eight02645999 | last post by:
hi i am using a telnet session to simulate an authentication mechanism USER = "user" PASSWORD = "password" try: telnet = telnetlib.Telnet(HOST) telnet.set_debuglevel(5)...
1
4134
by: mike11d11 | last post by:
Can anyone give me an example of how to use winsock control in a form, I'm trying to get a telnet session in one of my access database forms.
0
2114
by: J | last post by:
Hello. Does anyone know if there is a way to end a user's logged on Windows Authentication session? I have some .asp files that make calls to our SQL Server which can only be accessed through...
3
3638
by: =?Utf-8?B?cGlja2VkYW5hbWU=?= | last post by:
Hi, I am trying to establish a telnet session to do screen scraping. This device returns some custom escape sequences, which I can ignore, and some standard escape seq's. At your suggestion, I...
1
2305
by: Samuel | last post by:
Hi, I am trying to automate a telnet session (currently using Python's telnetlib) and would like to echo any response of the remote host to stdout, as soon as it arrives on telnetlib's open TCP...
3
3307
by: Moogoo | last post by:
Hello all, I am new to c++, coming from a Java background. Thank you in advance for anyone that can answer the question below: GOAL: I am currently writing a shell application for a...
0
7391
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7054
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7501
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5633
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5056
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4713
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3204
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1564
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
768
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.