470,855 Members | 1,193 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,855 developers. It's quick & easy.

cross platform libraries

I am using python on a linux terminal.

I want to shutdown a remote windows box. I found a script which does
something like this. My question is can we use windows libraries in
linux as follows ....

import win32api
import win32con
import win32netcon
import win32security
import win32wnet

def shutdown(parameters):
OTHER CODE HERE

Every help is appreciated.

May 4 '06 #1
7 954
No! That's not the way things work. Such code needs to run locally (in
this case, Windows). You can run this program as a daemon on Windows
with some nice simple remote interface (Eg: xmlrpc) and send a message
to trigger the shutdown.

May 5 '06 #2
Hi Ravi,

Do you have any idea how to perform such triigers ?
Every help is appreciated.
Ravi Teja wrote:
No! That's not the way things work. Such code needs to run locally (in
this case, Windows). You can run this program as a daemon on Windows
with some nice simple remote interface (Eg: xmlrpc) and send a message
to trigger the shutdown.


May 5 '06 #3
I went to this webpage

http://aspn.activestate.com/ASPN/Coo.../Recipe/360649

Isn't it supposed to run on the network and close the connected
machine.

Every help is appreciate,
Dennis Lee Bieber wrote:
On 4 May 2006 09:57:15 -0700, di********@gmail.com declaimed the
following in comp.lang.python:
I am using python on a linux terminal.

I want to shutdown a remote windows box. I found a script which does
something like this. My question is can we use windows libraries in
linux as follows ....

import win32api
import win32con
import win32netcon
import win32security
import win32wnet

That set... HIGHLY UNLIKELY... They all rely upon having the M$
kernel DLLs available...

Now, if the remote box is running a telnet server, you might be able
to telnet over (logging in as the boxes admin account) and initiate a
shutdown from it... (I seem to have a "shutdown.exe" on my system).
--
Wulfraed Dennis Lee Bieber KD6MOG
wl*****@ix.netcom.com wu******@bestiaria.com
HTTP://wlfraed.home.netcom.com/
(Bestiaria Support Staff: we******@bestiaria.com)
HTTP://www.bestiaria.com/


May 5 '06 #4
di********@gmail.com wrote in
news:11**********************@g10g2000cwb.googlegr oups.com:
I went to this webpage

http://aspn.activestate.com/ASPN/Coo.../Recipe/360649

Isn't it supposed to run on the network and close the connected
machine.
That code uses the windows libraries on the machine it is run on to
generate a request to the networked machine to shutdown. The code
executes locally and sends the request over the network.
Every help is appreciate,


If you have some way of remotely running programs on the windows
machine(ssh, telnet, etc.), you might try pstools:

http://www.sysinternals.com/Utilities/PsTools.html

specifically, psshutdown.

max

May 5 '06 #5
Can we have some program in Linux which shuts down the windows computer
remotely.

Every help is appreciated.
Max Erickson wrote:
di********@gmail.com wrote in
news:11**********************@g10g2000cwb.googlegr oups.com:
I went to this webpage

http://aspn.activestate.com/ASPN/Coo.../Recipe/360649

Isn't it supposed to run on the network and close the connected
machine.


That code uses the windows libraries on the machine it is run on to
generate a request to the networked machine to shutdown. The code
executes locally and sends the request over the network.
Every help is appreciate,


If you have some way of remotely running programs on the windows
machine(ssh, telnet, etc.), you might try pstools:

http://www.sysinternals.com/Utilities/PsTools.html

specifically, psshutdown.

max


May 5 '06 #6
Through Wine maybe ?

Philippe
Dennis Lee Bieber wrote:
On 4 May 2006 09:57:15 -0700, di********@gmail.com declaimed the
following in comp.lang.python:
I am using python on a linux terminal.

I want to shutdown a remote windows box. I found a script which does
something like this. My question is can we use windows libraries in
linux as follows ....

import win32api
import win32con
import win32netcon
import win32security
import win32wnet

That set... HIGHLY UNLIKELY... They all rely upon having the M$
kernel DLLs available...

Now, if the remote box is running a telnet server, you might be able
to telnet over (logging in as the boxes admin account) and initiate a
shutdown from it... (I seem to have a "shutdown.exe" on my system).
--
Wulfraed Dennis Lee Bieber KD6MOG
wl*****@ix.netcom.com wu******@bestiaria.com
HTTP://wlfraed.home.netcom.com/
(Bestiaria Support Staff: we******@bestiaria.com)
HTTP://www.bestiaria.com/


May 5 '06 #7
Not much to it. Just follow the SimpleXMLRPCServer example from Python
docs and register your shutdown function. Call it using xmlrpclib
remotely.

Actually, I prefer the telnet method below. Simple and straight forward.

May 6 '06 #8

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

5 posts views Thread by Clark K | last post: by
1 post views Thread by Paul Tremblay | last post: by
5 posts views Thread by sandwich_eater | last post: by
1 post views Thread by RShadow | last post: by
1 post views Thread by Simon | last post: by
5 posts views Thread by Michael Reichenbach | last post: by
12 posts views Thread by Tomás Ó hÉilidhe | last post: by
42 posts views Thread by =?ISO-8859-1?Q?Tom=E1s_=D3_h=C9ilidhe?= | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.