tramp-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: tramp (2.2.3-pre); [Feature Request] Use winexe to execute shell com


From: Dave Abrahams
Subject: Re: tramp (2.2.3-pre); [Feature Request] Use winexe to execute shell commands on windows
Date: Mon, 08 Aug 2011 07:41:06 -0400
User-agent: Gnus/5.110018 (No Gnus v0.18) Emacs/23.3 (darwin)

on Mon Aug 08 2011, Michael Albinus <michael.albinus-AT-gmx.de> wrote:

> Dave Abrahams <address@hidden> writes:
>
>>> What I don't understand is the relationship to Samba 4. Will it be part
>>> of Samba 4, in the future? Or will there be something different in Samba
>>> 4, with the same functionality?
>>
>> I wish I knew.  I _think_ it just uses a bunch of the samba 4
>> infrastructure, but I could be wrong.
>
> There was a winexe in the Debian/Ubuntu package wmi-client. It isn't
> available in the official repositories any longer, see
> <http://www.mikepalmer.net/archives/134>:
>
> "The old wmi-client package that used to be in debian was pulled due to
>  the forked/branched nature of the source code as well as the idea that
>  something better could be implemented with the upcoming Samba4 release."
>
> Btw, if I try to connect with winexe towards the laptop of my wife (Win7
> Home), I get an error. Does it need Win 7 Pro on the remote side? Samba?
> Special admin rights?


Here's what I used to get it working:

http://ubuntuforums.org/archive/index.php/t-900051.html gave me

--8<---------------cut here---------------start------------->8---
svn co http://dev.zenoss.org/svn/trunk/wmi/Samba/source
mv source winexe-source-2010.04.09
cd winexe-source-2010.04.09
./autogen.sh
./configure
make proto bin/winexe
sudo checkinstall -D cp bin/winexe /usr/local/bin/.
--8<---------------cut here---------------end--------------->8---

On macports you need to configure --with-libiconv=/opt/local.

On the windows side, 
http://community.zenoss.org/message/42193#42193 gave me:

--8<---------------cut here---------------start------------->8---
  Click Start
  Right click on Command Prompt
  Choose Run As Administrator
  In the command prompt, run:
  sc create winexesvc binPath= C:\WINDOWS\WINEXESVC.EXE start= auto 
DisplayName= winexesvc
--8<---------------cut here---------------end--------------->8---

Then
http://chall32.blogspot.com/2010/02/how-to-enable-access-windows-7.html
added some critical steps.

--8<---------------cut here---------------start------------->8---
1.  Enable Use Sharing Wizard
Click Start
Click Computer
Click Organize and Folder and Search Options
Select View tab
Ensure that Use Sharing Wizard is selected:

Click OK
2.  Open Windows Firewall
Click Start 
Click Control Panel
Click Category and select Small Icons
Click Windows Firewall
Click Allow a Program or feature through Windows Firewall
Find File and Printer Sharing and enable Home/Work and Public network

 Click OK and close Control Panel
3. Enable Local Account Token Filter Policy
This is the new bit.
Click Start
Type regedit in the Start Search box, and then click regedit in the Programs 
list.
Expand the following subkey:
      
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System
If the LocalAccountTokenFilterPolicy registry entry does not exist, follow 
these steps: 
On the Edit menu, click New, and then click DWORD Value
Type LocalAccountTokenFilterPolicy, and then press ENTER
Right-click LocalAccountTokenFilterPolicy, and then click Modify
In the Value data box, type 1, and then click OK
Exit Registry Editor
Job done.  No need to reboot.

For further reading on see KB951016
--8<---------------cut here---------------end--------------->8---

An important part of this is being able to get to shared disks
efficiently, so I can compile code on windows that I've been working on
on my mac.  With virtualbox, \\vboxsrv\ is the name of the built-in
sharing server.

--8<---------------cut here---------------start------------->8---
pluto:~/src/winexe.2 dave% bin/winexe -U 'win7ult32/dave%factoring60&upraised' 
//win7Ult32 cmd.exe<<EOF
heredoc> @echo off
heredoc> net use q: \\\\vboxsrv\downloads
heredoc> q:
heredoc> dir *.el
heredoc> exit
heredoc> EOF
Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation.  All rights reserved.

C:\Windows\system32>@echo off
net use q: \\vboxsrv\downloads
The command completed successfully.

q:
dir *.el
 Volume in drive Q is VBOX_downloads
 Volume Serial Number is 0E00-0002

 Directory of Q:\

05/24/2011  12:34 PM            65,741 develock.el
08/18/2009  12:19 PM            46,702 zenburn.el
               2 File(s)        112,443 bytes
               0 Dir(s)  18,548,432,896 bytes free
exit
pluto:~/src/winexe.2 dave% 
--8<---------------cut here---------------end--------------->8---

\o/

-- 
Dave Abrahams
BoostPro Computing
http://www.boostpro.com



reply via email to

[Prev in Thread] Current Thread [Next in Thread]