在 Windows 上掛載共享,從 linux 透過 winexe

在 Windows 上掛載共享,從 linux 透過 winexe

答案必須使用winexe。

我正在使用 winexe(在 Linux 上)透過以下命令在遠端 Windows 7 上掛載 samba 共享:

./bin/winexe -U <user>%<password> //<ip> "cmd.exe /c net use x: \\<ip>\share <password> /user:<user>"

這給了我:

System error 67 has occurred. The network name cannot be found.

但是當我這樣做時:

./bin/winexe -U <user>%<password> //<ip> "cmd.exe"

然後繼續輸入我的linux機器上給出的命令列提示符

"net use x: \\<ip>\share <password> /user:<user>""

它工作得很好。我怎麼能讓它像我的第一個命令一樣在一行上工作?

答案1

你可以在linux下嘗試這樣的事情

mount -t cifs -o username=your_name,password=your_pass //192.168.1.1/shared_path /mnt/mount_point

答案2

正如 Zoredache 所建議的,字元\需要轉義。

正確的命令應該是:

./bin/winexe -U <username>%<password> //<ip> "cmd.exe /c net use x: \\\\<ip>\\share    /user:<user> <password>"

相關內容