gpt4 book ai didi

windows - 如何在批处理脚本中隐藏 'net use' 命令错误消息

转载 作者:可可西里 更新时间:2023-11-01 14:43:36 25 4
gpt4 key购买 nike

我正在尝试使用这行批处理脚本删除映射到网络目录的 y: 驱动器。

net use y: /d /y>nul

但在 y: 不存在或已删除的情况下。它给了我这个错误信息。

The network connection could not be found.
More help is available by typing NET HELPMSG 2250.

有没有办法避免打印这个错误?我试过 net use y:/d/y>nul>nul 但没有成功

最佳答案

首先你不能导致错误:

if exist y:\ net use y: /delete

关于windows - 如何在批处理脚本中隐藏 'net use' 命令错误消息,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38603914/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com