【问题标题】:failure to map drive on remote machine through winexe无法通过winexe映射远程机器上的驱动器
【发布时间】:2013-12-31 07:26:02
【问题描述】:

我正在尝试使用 ubuntu 中的 winexe 程序在远程 windows xp 机器上映射网络共享,但命令失败并出现以下错误。

命令:

./bin/winexe -U Domain1/Administrator%paswrd123 //192.168.4.38 'cmd /c net use Q: \\192.168.4.16\Mydrive pwd123 /USER:user /P:yes'

错误:

System error 1312 has occurred.

A specified logon session does not exist. It may already have been terminated.

我去远程系统登录并在本地运行net use命令,共享驱动器映射成功。

使用的命令:

net use Q: \\192.168.4.16\Mydrive pwd123 /USER:user /P:yes

我用谷歌搜索过,人们给出了检查命令语法的建议,命令的语法很好,并且在 Windows 系统上本地运行时工作正常。对此的帮助将不胜感激。

编辑:我在下面的用户名部分输入了域名,命令运行成功,但我无法在远程机器上找到共享驱动器。

./bin/winexe -U Domain1/Administrator%paswrd123 //192.168.4.38 'cmd /c net use Q:\\192.168.4.16\Mydrive pwd123 /USER:MUM\user /P:yes`' 
The command completed successfully.

【问题讨论】:

    标签: windows winexe


    【解决方案1】:

    对于您编辑的查询,您可以使用它让 NET 选择一个空闲的驱动器号,然后使用 NET 找出它分配的字母:

    net use * \\server\share
    for /f "tokens=2" %%i in ('net use ^| find "\\server\share"') do set netdrive=%%i
    echo %netdrive% has been mapped
    

    有关 net use 命令的详细信息,请参阅问题Mapping a network drive without hardcoding a drive letter in a batch file. 的已接受答案

    【讨论】:

    • 映射驱动器仅在重新启动后出现。但不是在命令执行之后。有相同的解决方法吗?
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-05-28
    • 2023-03-15
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多