Menu

#66 getting error while running "powershell cp" command in winexe1.1

1.1
open
nobody
None
medium
2015-01-21
2015-01-21
chetan3434
No

Hi,

I'm trying to run powershell cp (copy) command through winexe. I'm getting error,
cp : The user name or password is incorrect.

The same command is working fine on windows powershell,
cp C:\Users\chetan\cm.txt \<share_machine_ip>\share </share_machine_ip>

First I tried, \<share_machine_ip>
chetan@ubuntu:~/winexegit/winexe-winexe-waf/source$ build/winexe-static -U <domain>/<username>%<password> //<server_ip> "powershell cp C:\Users\chetan\cm.txt \\<share_machine_ip>\share"
cp : Could not find a part of the path 'C:\<share_machine_ip>\share'. </share_machine_ip>
At line:1 char:1</share_machine_ip></server_ip></password></username></domain></share_machine_ip>

  • cp C:\Users\chetan\cm.txt \<share_machine_ip>\share</share_machine_ip>
  • ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    • CategoryInfo : NotSpecified: (:) [Copy-Item], DirectoryNotFoundException
    • FullyQualifiedErrorId : System.IO.DirectoryNotFoundException,Microsoft.PowerShell.Commands.CopyItemCommand

Then changed, \\<share_machine_ip>
chetan@ubuntu:~/winexegit/winexe-winexe-waf/source$ build/winexe-static -U <domain>/<username>%<password> //<server_ip> "powershell cp C:\Users\chetan\cm.txt \\<share_machine_ip>\share"
cp : The user name or password is incorrect.
At line:1 char:1</share_machine_ip></server_ip></password></username></domain></share_machine_ip>

  • cp C:\Users\chetan\cm.txt \\<share_machine_ip>\share</share_machine_ip>
  • ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    • CategoryInfo : NotSpecified: (:) [Copy-Item], IOException
    • FullyQualifiedErrorId : System.IO.IOException,Microsoft.PowerShell.Commands.CopyItemCommand

Is the winexe command I used to copy is correct? (the same copy command is working in windows powershell directly).
Can someone please help in solving this error ?

Discussion


Log in to post a comment.