LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 08-12-2008, 01:02 PM   #1
paragkalra
Member
 
Registered: Sep 2006
Location: Nagpur, Maharashtra, India
Distribution: Debian, Ubuntu, Redhat, Fedora, SLES, OpenSUSE, FreeBSD, Mac OS X
Posts: 221

Rep: Reputation: 31
Executing a batch file on Windows from Linux using a Shell-Script


Hey Friends,

I am developing a shell-script to automate my daily work. At one stage I want my shell-script to execute a "batch" file on Windows.

Please let me know what all options are available to me like "telnet" etc.

I was wondering if it can be done through "ftp" or "smbclient" ?

Can it be done by making the shell-script calling a php script that will execute the batch file on the remote machine (perhaps by using one of the vast abundant functions it is having)? Would someone like to throw some light on it?

Last edited by paragkalra; 08-12-2008 at 01:05 PM.
 
Old 08-12-2008, 01:43 PM   #2
grepmasterd
Member
 
Registered: Aug 2003
Location: Seattle
Distribution: ubuntu, lately
Posts: 182
Blog Entries: 1

Rep: Reputation: 35
you can do this with telnet

I've tried telnet on Win2K (sorry, pretty out of date...) so it may work similarly on XP or Vista. Just be sure to set
NTLM = 0 under the settings. See this link: http://www.netadmintools.com/art246.html

here's the caveat - telnetting to a windows box from a *nix box doesn't always work well (I've noticed this primarily when I change the server port from 23 to something else, like 923). You may find that the 'return' key doesn't seem to work, and your typing may come through in chunks. This is because of a mis-matched mode control negotiation during the connection setup (yes, telnet negotiates a lot of control functionality under the hood, largely unknown to the end user).

I won't go into the details here, but I've managed to make this work by using a local .telnetrc file in my home directory:

~# cat .telnetrc
newt mode character

where 'newt' is the DNS name of my windows box to which I'm telnetting.

hope that helps
YMMV

ps. a better option would be to install an ssh server on windows.
 
Old 08-12-2008, 02:17 PM   #3
Mr. C.
Senior Member
 
Registered: Jun 2008
Posts: 2,529

Rep: Reputation: 63
Setup Cygwin and sshd on the Windows system. Then, you can write your script in standard shell scripting, and gain secure remote access.
 
Old 08-13-2008, 12:45 PM   #4
paragkalra
Member
 
Registered: Sep 2006
Location: Nagpur, Maharashtra, India
Distribution: Debian, Ubuntu, Redhat, Fedora, SLES, OpenSUSE, FreeBSD, Mac OS X
Posts: 221

Original Poster
Rep: Reputation: 31
thanks everyone for ur suggestions.........
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Change batch script to shell script alan.belizario Programming 5 03-31-2005 12:41 AM
Change batch script to shell script alan.belizario Linux - Software 1 03-30-2005 01:49 AM
Help w/ batch/shell script mikehlinuxquest Linux - General 5 09-13-2004 04:41 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 11:22 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration