从Windows通过Winexe在Windows上挂载共享

研究

答案必须使用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>""

它工作正常。我怎样才能像第一个命令一样在一行上工作?

研究

正如Zoredache所建议的那样,字符\必须逃脱。

正确的命令应为:

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

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章