While net use works everywhere, PowerShell offers richer control and better integration with modern authentication, including Azure AD and certificate-based logins.

The asterisk ( * ) tells Windows to prompt for a password without echoing it to the screen. For fully automated scripts (use with caution), you can include the password directly:

@echo off net use X: \\backupserver\daily /user:DOMAIN\svc_backup MyPassword /persistent:no if %errorlevel% neq 0 ( echo Mapping failed exit /b 1 ) robocopy X:\ C:\BackupDestination /MIR net use X: /delete