Re: How to execute command on remote windows machine

2013-09-03 Thread gaurangnshah
Hi alex 

I tried the command you suggested however it is giving me following error. 

ERROR: The RPC server is unavailable.

On Tuesday, 3 September 2013 11:03:17 UTC+5:30, alex23  wrote:
 On 3/09/2013 2:45 PM, gaurangns...@gmail.com wrote:
 
  I have a requirement where i need to kill one process on remote windows 
  machine.
 
  Following command just works fine if i have to kill process on local machine
 
 
 
  os.system('taskkill /f /im processName.exe')
 
 
 
  However I am not able to figure out how to execute this command on remote 
  windows machine.
 
 
 
 The simplest way is from your local machine. taskkill accepts a /s 
 
 parameter which can specify a remote machine by IP or name.
 
 
 
 http://technet.microsoft.com/en-us/library/bb491009.aspx



On Tuesday, 3 September 2013 11:03:17 UTC+5:30, alex23  wrote:
 On 3/09/2013 2:45 PM, gaurangns...@gmail.com wrote:
 
  I have a requirement where i need to kill one process on remote windows 
  machine.
 
  Following command just works fine if i have to kill process on local machine
 
 
 
  os.system('taskkill /f /im processName.exe')
 
 
 
  However I am not able to figure out how to execute this command on remote 
  windows machine.
 
 
 
 The simplest way is from your local machine. taskkill accepts a /s 
 
 parameter which can specify a remote machine by IP or name.
 
 
 
 http://technet.microsoft.com/en-us/library/bb491009.aspx
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: How to execute command on remote windows machine

2013-09-03 Thread Jean-Michel Pichavant


- Original Message -
 Hi alex
 
 I tried the command you suggested however it is giving me following
 error.
 
 ERROR: The RPC server is unavailable.

Hi,

Please do not top post :)
If python is installed on the remote machine, using execnet 
http://codespeak.net/execnet/ is very easy. Its only requirement is python 
being installed on both machines.

JM


-- IMPORTANT NOTICE: 

The contents of this email and any attachments are confidential and may also be 
privileged. If you are not the intended recipient, please notify the sender 
immediately and do not disclose the contents to any other person, use it for 
any purpose, or store or copy the information in any medium. Thank you.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: How to execute command on remote windows machine

2013-09-03 Thread random832
On Tue, Sep 3, 2013, at 0:45, gaurangns...@gmail.com wrote:
 Hi Guys, 
 
 I have a requirement where i need to kill one process on remote windows
 machine. 
 Following command just works fine if i have to kill process on local
 machine 
 
 os.system('taskkill /f /im processName.exe')
 
 However I am not able to figure out how to execute this command on remote
 windows machine. 
 
 Note: my local machine is also windows (machine from where i have to
 execute command)
 
 so is there any way i can execute command from windows machine on remote
 windows machine ?

The taskkill command actually has an option for this: /S. I don't know
what mechanism it uses or what you would have to do to give yourself
permission to use it.


-- 
Random832
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: How to execute command on remote windows machine

2013-09-03 Thread Jean-Michel Pichavant

- Original Message - 

 I tried it, however it seems really complicated.

 If you have used it before, can you show me how can i do it ?

 Gaurang Shah
 Blog: qtp-help.blogspot.com
 Mobile: +91 738756556

Please don't ask question off-list.

It's not complicated at all.

The documentation has a lot of examples:
http://codespeak.net/execnet/example/test_info.html#execute-source-code-in-subprocess-communicate-through-a-channel

makegateway by defaut execute the code on the local machine. You simply need to 
use something like 
makegateway(ssh=myRemoteMachine)

cheers,

JM


-- IMPORTANT NOTICE: 

The contents of this email and any attachments are confidential and may also be 
privileged. If you are not the intended recipient, please notify the sender 
immediately and do not disclose the contents to any other person, use it for 
any purpose, or store or copy the information in any medium. Thank you.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: How to execute command on remote windows machine

2013-09-03 Thread 88888 Dihedral
gauran...@gmail.com於 2013年9月3日星期二UTC+8下午12時45分57秒寫道:
 Hi Guys, 
 
 
 
 I have a requirement where i need to kill one process on remote windows 
 machine. 
 
 Following command just works fine if i have to kill process on local machine 
 
 
 
 os.system('taskkill /f /im processName.exe')
 
 
 
 However I am not able to figure out how to execute this command on remote 
 windows machine. 
 
 
 
 Note: my local machine is also windows (machine from where i have to execute 
 command)
 
 
 
 so is there any way i can execute command from windows machine on remote 
 windows machine ?

This is trivial. First install the VNC on the remote site and 
make sure your VNC is working in the proper forground.

Just write a mouse/keyboard emulator service on the remote site 
with the propper port opened by python scripts.

Use the control computer  to send commands  to the remote site.

This scheme will work under unix-linux-windows OS.

-- 
https://mail.python.org/mailman/listinfo/python-list


How to execute command on remote windows machine

2013-09-02 Thread gaurangnshah
Hi Guys, 

I have a requirement where i need to kill one process on remote windows 
machine. 
Following command just works fine if i have to kill process on local machine 

os.system('taskkill /f /im processName.exe')

However I am not able to figure out how to execute this command on remote 
windows machine. 

Note: my local machine is also windows (machine from where i have to execute 
command)

so is there any way i can execute command from windows machine on remote 
windows machine ?
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: How to execute command on remote windows machine

2013-09-02 Thread Steven D'Aprano
On Mon, 02 Sep 2013 21:45:57 -0700, gaurangnshah wrote:

 so is there any way i can execute command from windows machine on remote
 windows machine ?

You are looking for information on Remote Procedure Calls, or RPC.

There are obvious security implementations from enabling RPC, imagine if 
random people on the internet could shut down whichever processes they 
like on your machine. But having said that, there are a number of 
excellent RPC libraries for Python. Here are two I have (briefly) used:

http://pythonhosted.org/Pyro4/

https://pypi.python.org/pypi/rpyc



-- 
Steven
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: How to execute command on remote windows machine

2013-09-02 Thread alex23

On 3/09/2013 2:45 PM, gaurangns...@gmail.com wrote:

I have a requirement where i need to kill one process on remote windows machine.
Following command just works fine if i have to kill process on local machine

os.system('taskkill /f /im processName.exe')

However I am not able to figure out how to execute this command on remote 
windows machine.


The simplest way is from your local machine. taskkill accepts a /s 
parameter which can specify a remote machine by IP or name.


http://technet.microsoft.com/en-us/library/bb491009.aspx
--
http://mail.python.org/mailman/listinfo/python-list