LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 05-11-2004, 04:58 PM   #1
joelhop
Member
 
Registered: Mar 2004
Location: Pennsylvania::USA
Distribution: Fedora Core 6
Posts: 100

Rep: Reputation: 15
Question Linux box calling a batch script on a windows box to run? Is it possible?


A certain linux box runs a series of tests, if one of the tests fails I need a windows box to run a batch script. Is it possible, to have the linux box order the windows box to run that batch script as in:

if something doesn't happen
run file.bat (on windows box)
fi

I know you can use rpcclient to shut down windows boxes remotely so i'm thinking you could probably run a script or a program that runs that script any ideas?

- karl hungus
 
Old 05-11-2004, 05:47 PM   #2
leonscape
Senior Member
 
Registered: Aug 2003
Location: UK
Distribution: Debian SID / KDE 3.5
Posts: 2,313

Rep: Reputation: 48
Your going to need somekind of program on the windows box waiting for instructions from the linux box to execute the batch script. I don't think theres a simpler way around this.

Something like ssh/telnet or similar waiting to carry out what the Linux box tells it.
 
Old 05-11-2004, 07:36 PM   #3
infamous41md
Member
 
Registered: Mar 2003
Posts: 804

Rep: Reputation: 30
just write a simple server that listens for a connection, and upon receiving a give string performs the command. doing this, and doing this securely are 2 different things however. on the linux side, all u would need to do is netcat to the port and write the command string, which would be done simply im script.
 
Old 05-11-2004, 10:30 PM   #4
joelhop
Member
 
Registered: Mar 2004
Location: Pennsylvania::USA
Distribution: Fedora Core 6
Posts: 100

Original Poster
Rep: Reputation: 15
Thumbs up Program to complete task

Yeah I was thinking a program could do it. Security is of the highest priority on the windows box it would need to be install on, this is my concern and why I was hesitant to allow possible access like that. Do you think it could be done completely securely with a program and are there no alternatives to installing a program? Thanks
 
Old 05-11-2004, 11:49 PM   #5
lucktsm
Member
 
Registered: May 2004
Location: Atlanta, GA USA
Distribution: Redhat ES4, FC4, FC5, slax, ubuntu, knoppix
Posts: 155

Rep: Reputation: 30
If I am not mistaking you can execute Windows commands and scripts from *nix with Windows UNIX Services. I am pretty sure it's up to version 2 or greater and it's pretty good.
 
Old 05-12-2004, 11:42 AM   #6
infamous41md
Member
 
Registered: Mar 2003
Posts: 804

Rep: Reputation: 30
Re: Program to complete task

Quote:
Originally posted by joelhop
Yeah I was thinking a program could do it. Security is of the highest priority on the windows box it would need to be install on, this is my concern and why I was hesitant to allow possible access like that. Do you think it could be done completely securely with a program and are there no alternatives to installing a program? Thanks
i can't answer 2nd question, but i can try and answer the first. the obvious security hazard is that anyone else could just connect to your server and cause it to execute the command that you are. a possible solution couldl be requiring the user to enter a certain "password" string and then execute the command. so now you're talking about storing a password inside of the program's data area, or having it read in a password from a conf. file or the registry. this introduces your next security issue, how to store that password. if you store it in a file or registry, then its possible for anyone on the windows box to read it. i dont know windows that well, so im not sure how to prevent that other than encryption. so the first time the program runs, it would check for a conf file, and if one didn't exist(race condition) then prompt the user for a passowrd, encrypt it, and store it in the file/registry. those are just some tings off top of my head, there are probly other thigns to consider as well depending on mission critical this is.
 
Old 05-13-2004, 03:54 PM   #7
joelhop
Member
 
Registered: Mar 2004
Location: Pennsylvania::USA
Distribution: Fedora Core 6
Posts: 100

Original Poster
Rep: Reputation: 15
Windows UNIX Services, this is something I'm not at all familiar with, can anyone give me a little more information on how I might use this to execute windows programs/batch files remotely from a linux box?
 
Old 05-17-2004, 12:49 PM   #8
BruceC
Member
 
Registered: Jul 2003
Posts: 34

Rep: Reputation: 15
Microsoft SFU 3.5 has been released and is the first version that is a free download (223 MB).
Try this link:
http://www.microsoft.com/downloads/d...DisplayLang=en

or search for ServicesForUnix3.5

SFU allows your Windows machine to act like a UNIX, even run UNIX shell scripts and programs.
 
Old 05-17-2004, 04:49 PM   #9
joelhop
Member
 
Registered: Mar 2004
Location: Pennsylvania::USA
Distribution: Fedora Core 6
Posts: 100

Original Poster
Rep: Reputation: 15
Smile Microsoft SFU 3.5

Thanks Bruce, i'm downloading that installation file now! It sounds really cool.

-Karl
 
  


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
Troubleshooting Slow Transfer Speed Between Linux Box and Windows Box timswim78 Linux - General 1 10-23-2005 11:45 AM
Windows XP box losing connection to Linux box after 30 sec. NeoZeus Linux - Networking 3 07-21-2005 12:02 AM
Linux box with eth0 to cable modem and eth1 to Windows box videojeff Linux - Networking 23 03-03-2005 07:58 PM
call program on linux box from windows batch file naijaguy Programming 5 08-14-2004 11:12 AM
Transfairing files from windows xp box to mandrake linux 10.0 box. tyledogg Linux - Newbie 4 07-25-2004 11:24 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 09:39 AM.

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