【问题标题】:How can I mount network drive on azure vm by using run command?如何使用运行命令在 azure vm 上挂载网络驱动器?
【发布时间】:2019-07-23 23:49:54
【问题描述】:
  1. 我在 azure VM 页面的 Run Command 中使用了这个 PowerShell 脚本。 Image1

Test-NetConnection -ComputerName [name] -Port 445

Invoke-Expression -Command "cmdkey /add:[path] /user:[username] /pass:[password]

网络使用 Y:\[路径] /u:[用户名]

  1. 返回成功
  2. 但是当我进入虚拟机时发现错误如下: Image2

我不知道这有什么问题。 有没有人也遇到过这个问题?

【问题讨论】:

    标签: azure automount


    【解决方案1】:

    您使用 net use 安装驱动器,这在 Windows 上已经有一段时间了。

    检查Command PromptPowershell中的驱动器号,如果挂载命令成功,它应该在那里。

    【讨论】:

    • 感谢您的回复,但我在 azure run 命令服务上使用该命令,它显示成功,但我的 vm 上看不到任何内容
    最近更新 更多