Operating System - HP-UX
1838660 Members
10775 Online
110128 Solutions
New Discussion

How to execute a windows command from Unix?

 
SOLVED
Go to solution
Jan Shu
Regular Advisor

How to execute a windows command from Unix?

Hi All,

Can I execute a windows command from Unix? For example "dir" command, and start the command from Unix side. The environment is Windows 2000 sp4 and HP-UX 11.0. There is restriction, the process has to be fully automated. no prompts for passwords or logins.

Please help.

Regards,
Jan
6 REPLIES 6
Mark Greene_1
Honored Contributor

Re: How to execute a windows command from Unix?

If I understand what you are trying to accomplish, you first question is what funtions do you need? That will tell you what method of connectivity between the Windows server and the Unix server you will have from which to chose.

If all you need is file access, Samba might be the tool you need. If you need an interactive environment on the Window's side of the connection, you are limited to ftp and http. FTP will require a login, unless you use anonymous which introduces security risks. HTTP requires a login and password unless you are going to implement ssl and share certificate info. It's not a trival setup.

So, what sort of work are you wanting to do on the Window's side?

mark
the future will be a lot like now, only later
Mark Grant
Honored Contributor

Re: How to execute a windows command from Unix?

There is also rexec available on windows but that requires a password too. Following on from Mark's (the one in the earlier post) I think the web server idea is quite an innovative little solution. You could run a webserver and a cgi-script to accept requests from the unix box to run commands. A bit belt and braces but it might get you want you want. You could of course, script the request to the webserver or even just use telnet
Never preceed any demonstration with anything more predictive than "watch this"
Steven E. Protter
Exalted Contributor
Solution

Re: How to execute a windows command from Unix?

There is a version of Secure Shell, SSH which ships for windows.

You can find it by searching ssh at download.com, install it and then use it as follows:

ssh user@hostname "dir"

You will be prompted for a password, but the command will execute.

You can exchange public keys so the same unix user can bypass passwords on the windows box. Attaching a reference doc.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Hemanth Gurunath Basrur
Honored Contributor

Re: How to execute a windows command from Unix?

Gary Yu
Super Advisor

Re: How to execute a windows command from Unix?

How about using NFS to mount the windows drive on the HP server, I know windows NT can export directories, not sure about win2000...

thanks,
Gary
Steven E. Protter
Exalted Contributor

Re: How to execute a windows command from Unix?

I did totally forget this.

You can install CIFS/9000, which is samba. Then you can mount a shared drive on the Windows 2000 system and do directory type commands on it. Somewhat limited in what you can do, but if your aim is dir and other disk operations, Samba is safe and secure.

Server:
http://software.hp.com/portal/swdepot/displayProductInfo.do?productNumber=B8725AA
Client:
http://software.hp.com/portal/swdepot/displayProductInfo.do?productNumber=B8724AA

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com