Operating System - HP-UX
1832363 Members
2356 Online
110041 Solutions
New Discussion

Triggering .BAT file from HPUX

 
Tim Medford
Valued Contributor

Triggering .BAT file from HPUX

Has anyone ever tried to fire off a .bat file on a Windows2000 server remotely from an HPUX shell? I'm guessing their might be some kind of rshell or rexec technology that works on windows?

The .bat file will be used to stop and start services on the Windows side.

Sorry to ask such an open-ended question, but I'm not really sure where to even start with this one.

Thanks in advance,
Tim
6 REPLIES 6
A. Clay Stephenson
Acclaimed Contributor

Re: Triggering .BAT file from HPUX

Because I find batch files to be so crippled, I suggest that you write them in the shell using the MKS toolkit: http://www.mkssoftware.com/

You will then have all the tools and authentication that you are familiar with. The downside is that it's not free.

If it ain't broke, I can fix that.
A. Clay Stephenson
Acclaimed Contributor

Re: Triggering .BAT file from HPUX

Hi again Tim:

Plan B (similar to above but free):http://www.cygwin.com/
If it ain't broke, I can fix that.
Tim Medford
Valued Contributor

Re: Triggering .BAT file from HPUX

Thanks for the response Clay. I agree and normally use the Reed-Kotler unix toolkit for windows.

In this case, all that the BAT file needs to do is a "net stop" and "net start" command.

My real quesiton is getting at the connectivity between Unix and windows. Whether this ends up in a BAT file or a Unix script over on Windows, how would I send a message from my HP9000/UX server over to a Windows server to tell it to execute the file?
A. Clay Stephenson
Acclaimed Contributor

Re: Triggering .BAT file from HPUX

I thought I was answering this very questions. Both of the packages that I listed will respond to remsh commands from your UNIX host just as though you were remsh'ing to another UNIX box.

There is also a W2K resource kit (go to www.microsoft.com and search for "Remote Commands"), that can be made to work but I always fall back on MKS or Cygwin. Both are rock solid and will do just what you want.

Plan C. Write a perl listener using sockets to execute commands sent from a perl client on your UNIX box. That method works quite well but you must build in the security yourself. (Perl is available as a free download for Windows boxes.).

If it ain't broke, I can fix that.
Jon Finley
Honored Contributor

Re: Triggering .BAT file from HPUX

You also now have telnet ability in Win2k.

You "should" be able to simply script the telnet, login, kick off the bat file, sleep for a bit then log off from the session.

The telnet daemon on Win2k has a commandline tool you will need to run to change the default behavior of the type of challenge/responce to be expected.


Jon
"Do or do not. There is no try!" - Yoda
A. Clay Stephenson
Acclaimed Contributor

Re: Triggering .BAT file from HPUX

Hi again Tim:

I should add that while Cygwin does have a good shell and UNIX utilities like awk; it does not have remshd. If you want to remsh (or rexec) from UNIX to Windows then MKS Toolkit is the weapon.
If it ain't broke, I can fix that.