winexe is tool that can execute commands on WIN machines from Linux servers

winexe syntax should be as the following:

      winexe -U [Domain/]User%Password //host command

Because I have windows 7 that work as workgroup, I can defined in winexe syntax the domain name

question: is it possible to use the winexe without the domain name ? , or maybe there are some magic ideas that can help me with this case ?


winexe started without arguments shows list of options, using "--help" will show their descriptions. Most of the tasks can be done using syntax:

   winexe -U [Domain/]User%Password //host command

Where 'host' can be given as ip number or DNS hostname and 'command' is a command which will be run on remote system.


 # winexe -U HOME/Administrator%Pass123 // "ipconfig /all"

 # winexe -U HOME/Administrator%Pass123 //host 'cmd /C dir C:\'

domain name - HOME


The "Domain/" between [ and ] means it is optional, so this should work:

winexe -U User%Password //host command

If that does not work use the target hostname as Domain:

winexe -U host/User%Password //host command

This works because windows uses its local user database when domain = hostname. Maybe ./User%Password (notice the dot) also works. The dot as Domain means "lookup your own database", too.

  • No I already try this its not work if domain not set in the winexe command – nils Jul 5 '13 at 13:01
  • Have you tried to use the target hostname as domain? – krissi Jul 5 '13 at 13:05
  • what you mean as domain the target host is the IP address of the WIN server ? , give me example so will try . – nils Jul 5 '13 at 14:11
  • when your target host is //targethost use winexe -U targethost/Administrator%Pass123 //targethost command – krissi Jul 5 '13 at 14:45
  • I add the targethost in /etc/hosts and with his IP address and run this: winexe -U $targethost/Administrator%Pass123 //192.9l.22.19 , now its work - but how can exaplin this ? , I mean how the $targethost IP works in place of domain name ? – nils Jul 5 '13 at 16:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.