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.
相关推荐
caimouse9 小时前
Reactos 第 5 章 进程与线程 — 5.8 Windows 的 APC 机制
c语言·windows
PHP隔壁老王邻居10 小时前
windows菜单搜索栏无法显示历史记录或者无法使用修复方法
windows
道一2310 小时前
Windows系统查看端口占用进程的3种实用方法
windows·笔记
半条-咸鱼10 小时前
【INACCESSIBLE_BOOT_DEVICE】安装 Config Tool 后 Windows 蓝屏,最终通过 VMware 虚拟机解决
windows·stm32·vmware·芯片
人工小情绪11 小时前
Windows 安装 Codex 桌面版,并用 CC Switch 管理配置
人工智能·windows·codex·cc switch
caimouse13 小时前
Reactos 第 5 章 进程与线程 — 5.11 线程本地存储 TLS
c语言·windows
李小白6614 小时前
第二天-认识Windows
windows
liu64491133715 小时前
claude code 安装
windows
caimouse15 小时前
Reactos 第 5 章 进程与线程 — 5.9 Windows 线程的调度和切换
windows
骑士雄师15 小时前
17.2 通过 Config 传入用户名 → 工具1存入 State → 工具2读取 State 并返回答案
服务器·windows·microsoft