windows@允许挂载http链接@挂载局域网http链接

文章目录

资源管理器挂载网络驱动器👺

允许http链接映射为磁盘驱动器😊

  • 下面的操作将是的windows能够将http链接映射为驱动器

  • 首先,您需要使用管理员方式 打开cmd或者powershell

  • 如果目标明确,执行类似以下操作的命令

    • reg add HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\WebClient\Parameters /v BasicAuthLevel /t REG_DWORD /d 2
  • 实操

    • 可以先查询一下原来的值

      bash 复制代码
      [BAT:78%][MEM:35.12% (11.13/31.70)GB][14:56:31]
      [~\Desktop]
      PS>reg query HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\WebClient\Parameters /v  BasicAuthlevel
      
      HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\WebClient\Parameters
          BasicAuthlevel    REG_DWORD    0x1
    • 用管理员权限修改

      bash 复制代码
      [BAT:78%][MEM:35.07% (11.12/31.70)GB][14:56:52]
      [~\Desktop]
      PS>reg add HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\WebClient\Parameters /v  BasicAuthLevel /t REG_DWORD /d 2
      Value BasicAuthLevel exists, overwrite(Yes/No)? yes
      The operation completed successfully.
    • 然后要重启系统

  • 重新检查是否可以映射!

可选更改:文件大小限制
cmd 复制代码
reg add HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\WebClient\Parameters /v  FileSizeLimitInBytes /t REG_DWORD /d 0xffffffff
  • 实操

    bash 复制代码
    #查询修改前的值
    [BAT:78%][MEM:35.89% (11.38/31.70)GB][15:01:25]
    [~\Desktop]
    PS>reg query HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\WebClient\Parameters /v  FileSizeLimitInBytes
    
    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\WebClient\Parameters
        FileSizeLimitInBytes    REG_DWORD    0x2faf080
    
    [BAT:78%][MEM:35.80% (11.35/31.70)GB][15:02:32]
    [~\Desktop]
    PS>reg add HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\WebClient\Parameters /v  FileSizeLimitInBytes /t REG_DWORD /d 0xffffffff
    Value FileSizeLimitInBytes exists, overwrite(Yes/No)? yes
    The operation completed successfully.

刷新使配置生效

  • 可以通过重启计算机来刷新
  • 也可以通过以下重启服务的方式刷新
重启webclient服务
  • 我们用管理员权限打开powershell操作:

    • 可选:Get-Service webclient查看服务详情
    • 再用Restart-Service WebClient重启服务
    bash 复制代码
    [BAT:78%][MEM:34.73% (11.01/31.70)GB][15:04:40]
    [~\Desktop]
    PS>Get-Service WebClient
    
    Status   Name               DisplayName
    ------   ----               -----------
    Running  WebClient          WebClient
    
    
    [BAT:78%][MEM:34.73% (11.01/31.70)GB][15:04:44]
    [~\Desktop]
    PS>Restart-Service WebClient

基本操作

执行映射

  • 关闭所有powershell(如果有的话)

  • 重新打开一个powershell进行驱动器映射(使用net use命令,详情另见它文)

  • 下面的试验是我在手机,假设机型为iqoo10pro,在局域网内的ip为192.168.1.165

    bash 复制代码
    PS>$iqoo10pro="192.168.1.165"
    PS>$iqoo10pro
    192.168.1.165
    #正式操作
    [BAT:78%][MEM:36.11% (11.45/31.70)GB][15:21:02]
    [~\Desktop]
    PS>set-AlistMobilePhone -MobilePhone $iqoo10pro -DriveLetter M
    Enter the user name for '192.168.1.165': admin
    Enter the password for 192.168.1.165:
    The command completed successfully.
    
    #映射结果检查
    [BAT:78%][MEM:36.19% (11.47/31.70)GB][15:21:12]
    [~\Desktop]
    PS>net use
    New connections will be remembered.
    
    
    Status       Local     Remote                    Network
    
    -------------------------------------------------------------------------------
                 M:        \\192.168.1.165@5244\dav  Web Client Network
                 W:        \\localhost@5244\dav      Web Client Network
    The command completed successfully.
  • 这里用到的函数set-AlistMobilePhone是对net use的封装

    复制代码
      function Set-AlistMobilePhone
      {
          <# 
          .SYNOPSIS
          $MobilePhone =$iqoo10pro
          net use W: "http://$MobilePhone:5244/dav" /p:yes /savecred 
          #>
          param(
              # 手机端ip地址
              $MobilePhone = $iqoo10pro,
              $DriveLetter = 'M'
          )
          net use "$($DriveLetter):" "http://$($MobilePhone):5244/dav" /p:yes /savecred 
          
          # >  %userprofile%/desktop/MapLog.txt 2> %userprofile%/desktop/MapErrLog.txt
      }

取消映射

bash 复制代码
[BAT:78%][MEM:37.94% (12.03/31.70)GB][15:27:58]
[M:\]
PS>net use M: /delete
There are open files and/or incomplete directory searches pending on the connection to M:.

Is it OK to continue disconnecting and force them closed? (Y/N) [N]: Y
M: was deleted successfully.
相关推荐
Mr_Xuhhh5 小时前
Java泛型进阶:从基础到高级特性完全指南
开发语言·windows·python
建行一世6 小时前
【Windows笔记本大模型“傻瓜式”教程】使用LLaMA-Factory工具来完成对Windows笔记本大模型Qwen2.5-3B-Instruct微调
windows·ai·语言模型·llama
王者鳜錸9 小时前
Windows安装OpenClaw龙虾助手
windows·龙虾·自动化脚本执行管家
大明者省11 小时前
Label Studio安装与启动
windows
武藤一雄11 小时前
C# 异常(Exception)处理避坑指南
windows·microsoft·c#·.net·.netcore·鲁棒性
soragui13 小时前
【Python】第 4 章:Python 数据结构实现
数据结构·windows·python
橘子编程14 小时前
操作系统原理:从入门到精通全解析
java·linux·开发语言·windows·计算机网络·面试
程序员大辉16 小时前
Win11精简版的天花板:Windows X-Lite 26H1 V3完整安装教程,老电脑也能装
windows·电脑
熊明才17 小时前
PM2 服务器服务运维入门指南
运维·服务器·windows
沉迷学习 日益消瘦17 小时前
(windows环境)白嫖阿里云百炼免费 Token 使用 Claude 教程
windows·阿里云·claude·token·百炼