ネットワークドライブの追加とかでWebClientが必要なときに使います。
@echo off set dt="" FOR /F "USEBACKQ" %%i IN (`sc query ^| findstr /i "WebClient"`) DO @SET DT=%%i IF %DT%=="" GOTO error GOTO end :error net start WebClient :end set dtnet="" FOR /F "USEBACKQ" %%i IN (`net use ^| findstr /i "z:"`) DO @SET DTNET=%%i IF %DTNET%=="" GOTO netend GOTO neterror :neterror net use /delete z: :netend net use z: {something_address} /USER:{user} {pass}