Executing a batch file on Windows from Linux using a Shell-Script
Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Distribution: Debian, Ubuntu, Redhat, Fedora, SLES, OpenSUSE, FreeBSD, Mac OS X
Posts: 221
Rep:
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.
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.