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.
相关推荐
集成显卡3 分钟前
windows 下使用 bat 批处理运行 Chrome 无头模式刷一波访问量
windows·程序员
路由侠内网穿透2 天前
本地部署 GPS 跟踪系统 Traccar 并实现外部访问
运维·服务器·网络·windows·tcp/ip
研华嵌入式3 天前
如何在高通跃龙QCS6490 Arm架构上使用Windows 11 IoT企业版?
arm开发·windows·嵌入式硬件
带娃的IT创业者3 天前
Windows 平台上基于 MCP 构建“文心一言+彩云天气”服务实战
人工智能·windows·文心一言·mcp
csdn_aspnet3 天前
Windows Node.js 安装及环境配置详细教程
windows·node.js
摇滚侠3 天前
java语言中,list<String>转成字符串,逗号分割;List<Integer>转字符串,逗号分割
java·windows·list
Source.Liu3 天前
【Pywinauto库】12.2 pywinauto.element_info 后端内部实施模块
windows·python·自动化
Source.Liu3 天前
【Pywinauto库】12.1 pywinauto.backend 后端内部实施模块
开发语言·windows·python·自动化
私人珍藏库3 天前
[Windows] FileOptimizer v17.1.0_一款文件批量压缩工具
windows·批量压缩
掘根3 天前
【CMake】List
windows·microsoft·list