重启后网络驱动器断开
我需要建议。 我在计算机上运行一个脚本,将文件复制到网络驱动器。它定期通过任务调度程序打开。 但在重新启动后,网络驱动器无法连接 - 即使当我设置它时我选中了“登录时重新连接”。 (通常我只需双击驱动器即可重新连接)。但如果我不这样做,脚本就无法将其放在任何地方,因为磁盘似乎不在那里。
我尝试过:
关闭快速启动,
启动后在文件夹中放入批处理文件:
@echo 创建新的 Y: 驱动器映射 net use Y: \\服务器\文件夹 :出口
将另一个批处理文件放入“after boot”文件夹中
<前><代码> @echo 关闭 :开始 超时 /t 5 /nobreak >NUL 如果存在 Y:\NUL 转到 End net use Y: \\服务器\文件夹 /USER:域\用户密码 /PERSISTENT:YES 如果错误级别 1 则转到开始 :结尾
但都没有解决问题。
I need advice.
I run a script on my computer that copies the files to the network drive. Periodically, it turns on via the task scheduler.
But it happens that after a reboot the network drive does not connect - even though when I set it up I checked "reconnect at login". (Usually I just double-click on the drive and it reconnects). But if I don't do this, the script can't put it anywhere because the disk doesn't seem to be there.
I tried:
turning off fast booting,
put a batch file in the folder after boot:
@echo Create new Y: drive mapping net use Y: \\server\folder :exit
put another batch file in the "after boot" folder
@echo off :Start timeout /t 5 /nobreak >NUL if exist Y:\NUL goto End net use Y: \\server\folder /USER:domain\user password /PERSISTENT:YES if ERRORLEVEL 1 goto Start :End
But neither solved the problem.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
几天前我就遇到了这个问题。
我使用的解决方案并不是很专业,但它确实有效。
我刚刚通过 powershell 在网络文件夹中创建了一个文本文件。
每次我现在重新启动我的电脑时,它只会在这个 txt 中写入最新的日期。
我知道它并不完美,但它有效。
I had exactly this problem some days ago.
The solution I used was nothing really professional, but it worked.
I just created a textfile via powershell within the networkfolder.
Everytime I now restart my PC it just writes the newest date in this txt.
I know its not perfect, but it works.
确保快速启动已禁用。
转到设备管理器 ->网络适配器->网络适配器的属性
转到组策略(执行 gpedit.msc )->计算机配置->管理模板 ->系统->登录并启用“计算机启动和登录时始终等待网络”。
将以下值添加到您的注册表中:
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System]
“EnableLinkedConnections”=dword:00000001
"LocalAccountTokenFilterPolicy"=dword:00000001
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon]
“GpNetworkStartTimeoutPolicyValue”=dword:0000003c
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\NetworkProvider]
“RestoreConnection”=dword:00000001
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Dnscache]
“开始”=dword:00000002
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters]
“自动断开连接”=dword:ffffffff
[HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer]
"LocalKnownFoldersMigerated"=dword:00000001
删除以下注册表项(如果存在)(其中“X”是连接的网络驱动器的盘符):
[HKEY_CURRENT_USER\Network\X]
[HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\映射网络驱动器 MRU]
“a”=“\服务器\路径”
“MRUList”=“a”
重新启动
手动映射您的网络驱动器:
\\192.168.0.10\MyShare
)并激活“登录时重新连接”将以下值添加到相应的注册表项(其中“X”是您连接的网络驱动器的盘符)
[HKEY_CURRENT_USER\Network\X]
"ProviderFlags"=dword:00000001
可选:将访问网络驱动器的任何现有任务延迟大约 10 秒。
重新启动并检查一切是否按预期工作。
net use
(shell 命令)的状态应显示“OK”。Ensure that fast boot is disabled.
Go to the Device Manager -> Network adapters -> Properties of your network adapter
Go to Group Policies (execute gpedit.msc) -> Computer Configuration -> Administrative Templates -> System -> Logon and enable "Always Wait for the Network at Computer Startup and Logon".
Add the following values to your registry:
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System]
"EnableLinkedConnections"=dword:00000001
"LocalAccountTokenFilterPolicy"=dword:00000001
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon]
"GpNetworkStartTimeoutPolicyValue"=dword:0000003c
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\NetworkProvider]
"RestoreConnection"=dword:00000001
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Dnscache]
"Start"=dword:00000002
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters]
"Autodisconnect"=dword:ffffffff
[HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer]
"LocalKnownFoldersMigrated"=dword:00000001
Remove the following registry entries, if they exist (where "X" is the letter of your connected network drive):
[HKEY_CURRENT_USER\Network\X]
[HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Map Network Drive MRU]
"a"="\Server\Path"
"MRUList"="a"
Reboot
Map your network drive manually:
\\192.168.0.10\MyShare
) and activate "Reconnect at sign-in"Add the following value to the corresponding registry key (where "X" is the letter of your connected network drive)
[HKEY_CURRENT_USER\Network\X]
"ProviderFlags"=dword:00000001
Optionally: Delay any existing tasks which access the network drive to about 10 seconds.
Reboot and check if everything works as expected. The status of
net use
(shell command) should say "OK".