網絡位置
- 無盤符
- 只是一個標記,功能不多,例如不能被設備上其它工程訪問到
- 占的通信流量少,如果只是簡單的文件傳輸,可以用這個
網絡驅動器
- 有盤符
- 相當於本地的磁盤
- 占的通信流量多
也有說 https://www.cnblogs.com/MrZivChu/p/network.html
網絡驅動器是針對的是局域網!
"映射網絡驅動器" 的意思是將局域網中的某個目錄映射成本地驅動器號,就是說把網絡上其他機器的共享的文件夾映射自己機器上的一個磁盤,這樣可以提高訪問時間。
"映射網絡驅動器"是實現磁盤共享的一種方法,具體來說就是利用局域網將自己的數據保存在另外一台電腦上或者把另外一台電腦里的文件虛擬到自己的機器上。
添加一個網絡位置
在磁盤資源管理器空白位置右擊“添加一個網絡位置”
...,按提示下一步就中可以 。
成功會在C:\Users\此處為自己的用戶名\AppData\Roaming\Microsoft\Windows\Network Shortcuts文件夾下生成一個文件
映射網絡驅動器
進入磁盤資源管理器窗口后,在工具欄下,找到並選擇“映射網絡驅動器”這一項,點擊打開。進入映射網絡驅動器創建窗口,先給要映射的網絡驅動器配置一個盤符,選擇“驅動器”這一項,在右側,點擊下拉框的倒三角按鈕。在列出的盤符中,這些都是未使用的盤符,從中選一個,在默認情況下,默認為“Z”,那就用默認的吧,這個可以自已定義選擇。
命令方法是:cmd執行:net use Y: http://domain/dav /user:用戶名 /persistent:YES 密碼
/persistent 表示保存映射,下次開機還在。
==================
比方說,我有100個用戶,我需要為每個用戶添加多個網絡位置.它們不能是網絡驅動器(例如Q :),因為某些用戶已經映射了超過26個驅動器.
我希望使用批處理文件或VBS腳本來執行此操作.通過添加網絡快捷方式,添加網絡位置..
經過一些測試,網絡位置是位於%AppData%\Microsoft\Windows\Network Shortcuts
文件夾中的只讀文件夾,其中包含兩個文件:desktop.ini
內容是文件夾的圖標信息和target.lnk
指向目標的快捷方式.
vbs腳本創建網絡位置
%AppData%\Microsoft\Windows\Network Shortcuts 文件夾中創建一個快捷方式:

1 Option Explicit 2 3 Const ssfNETHOOD = &H13& 4 5 Dim fso, shell, shellApplication 6 7 Set fso = WScript.CreateObject("Scripting.FileSystemObject") 8 Set shell = WScript.CreateObject("WSCript.Shell") 9 Set shellApplication = WScript.CreateObject("Shell.Application") 10 11 Dim networkLocationsFolder 12 networkLocationsFolder = shellApplication.Namespace( ssfNETHOOD ).Self.Path 13 14 With shell.CreateShortcut(fso.BuildPath( networkLocationsFolder, "Test PC22.lnk" )) 15 .TargetPath = "\\121.61.43.61@1013\DavWWWRoot\dav" 16 .WindowStyle = 1 17 .IconLocation = "shell32.dll, 9" 18 .Description = "Access to Test computer drive" 19 .WorkingDirectory = "" 20 .Save 21 End With

Option Explicit Function CreateNetworkLocation( networkLocationName, networkLocationTarget ) Const ssfNETHOOD = &H13& Const fsATTRIBUTES_READONLY = 1 Const fsATTRIBUTES_HIDDEN = 2 Const fsATTRIBUTES_SYSTEM = 4 CreateNetworkLocation = False ' Instantiate needed components Dim fso, shell, shellApplication Set fso = WScript.CreateObject("Scripting.FileSystemObject") Set shell = WScript.CreateObject("WScript.Shell") Set shellApplication = WScript.CreateObject("Shell.Application") ' Locate where NetworkLocations are stored Dim nethoodFolderPath, networkLocationFolder, networkLocationFolderPath nethoodFolderPath = shellApplication.Namespace( ssfNETHOOD ).Self.Path ' Create the folder for our NetworkLocation and set its attributes networkLocationFolderPath = fso.BuildPath( nethoodFolderPath, networkLocationName ) If fso.FolderExists( networkLocationFolderPath ) Then Exit Function End If Set networkLocationFolder = fso.CreateFolder( networkLocationFolderPath ) networkLocationFolder.Attributes = fsATTRIBUTES_READONLY ' Write the desktop.ini inside our NetworkLocation folder and change its attributes Dim desktopINIFilePath desktopINIFilePath = fso.BuildPath( networkLocationFolderPath, "desktop.ini" ) With fso.CreateTextFile(desktopINIFilePath) .Write "[.ShellClassInfo]" & vbCrlf & _ "CLSID2={0AFACED1-E828-11D1-9187-B532F1E9575D}" & vbCrlf & _ "Flags=2" & vbCrlf .Close End With With fso.GetFile( desktopINIFilePath ) .Attributes = fsATTRIBUTES_HIDDEN + fsATTRIBUTES_SYSTEM End With ' Create the shortcut to the target of our NetworkLocation Dim targetLink targetLink = fso.BuildPath( networkLocationFolderPath, "target.lnk" ) With shell.CreateShortcut( targetLink ) .TargetPath = networkLocationTarget .Save End With ' Done CreateNetworkLocation = True End Function CreateNetworkLocation "Tests", "\\192.168.1.2\c$"
網絡憑證帶來的危害是很大的,尤其對於一些不懂計算機和網絡的人來說。
給別人開完共享后一定要在別人的計算機上刪除網絡憑證(net use * /del)