Running batchfile from command prompt [message #130059] |
Thu, 28 July 2005 00:02 |
kinjal
Messages: 124 Registered: June 2001
|
Senior Member |
|
|
Hello,
I want to create a batchfile on my local PC.
Actually I want to run it through command prompt.
It should automatically connect to server(which is at remote location) and run the shell script from server's specified location. And after running shell script it should return to command prompt again.
Is it possible to do so?
Please help me. I want to do this as soon as possible.
Thanking you,
Kinjal
|
|
|
Re: Running batchfile from command prompt [message #130109 is a reply to message #130059] |
Thu, 28 July 2005 03:49 |
tarundua
Messages: 1080 Registered: June 2005 Location: India
|
Senior Member |
|
|
Hi Kinjal,
I m new to this DBA world so no exact answer but a thought strikes my mind and i want to discuss.
See, in the batch file --
--> Telnet that server from ur machine.
--> Run the command.
--> exit the telnet prompt
Even i m also interested in the exact reply.
Regards,
Tarun
|
|
|
Re: Running batchfile from command prompt [message #130678 is a reply to message #130109] |
Mon, 01 August 2005 22:55 |
kinjal
Messages: 124 Registered: June 2001
|
Senior Member |
|
|
Hi there,
My client is windows and remote server is Linux.
How can I connect remote server from my command prompt?
I dont want to use telnet directly.
Right now what is happening is, I have created a file which is having username and password to telnet the server.
But when I run this file from command prompt, it ask me for password and I have to manually enter the password.
What exactly I need is,
create a batchfile which can telnet the server(without asking for username/password), run the shell from particular location and exit the telnet.
And I want to make this batchfile run automatically at defined period.
I hope now the problem is more clearer..
Thanking you,
Kinjal
|
|
|
Re: Running batchfile from command prompt [message #130777 is a reply to message #130678] |
Tue, 02 August 2005 07:45 |
|
Mahesh Rajendran
Messages: 10708 Registered: March 2002 Location: oracleDocoVille
|
Senior Member Account Moderator |
|
|
If this is batchfile that needs to be run using a scheduler, why dont you schedule it directly in the remote linux machine?
A simple cronjob would solve all the issues.
Telnet is fleaky. If i am sysadmin, i would not allow any telnet session. SSH is the way to go. you can install cygwin or mkstoolkit kind of emulators to execute shell scripts from your dos prompt.
E:\>ver
Microsoft Windows 2000 [Version 5.00.2195]
E:\>ls -lrt
total 0
drwxrwxrwa 1 Administrators None 0 Jan 9 2003 somefiles
drwxrwxrwa 1 Administrators None 0 Mar 6 2003 Oracle
drwxrwxrwa 1 Administrators None 0 Aug 6 2003 Share
drwxrwxrwx 1 Administrators None 0 Aug 18 2003 ESSBASE
drwxrwxrwa 1 Administrators None 0 Aug 20 2003 ees files
drwxrwxrwx 1 Administrators None 0 Aug 9 2004 etl
E:\>ksh
$ uname -a
Windows_NT xxxxxxx 5 00 586
$
|
|
|