How to "ignore" username and password prompt in net use

I was never able to find a finite solution to the problem. But a usable (but very hacky and unclean) work around is using this command:

::Helpdesk
copy /Y NUL "\\BOB\helpdesk\.writable"
IF %ERRORLEVEL%==0 ( 
    del \\BOB\helpdesk\.writable
    GOTO:ALLOWEDHELPDESK
 ) 

GOTO:SECT2
:ALLOWEDHELPDESK
net use k: /delete
net use k: \\BOB\helpdesk 
:SECT2

::Onboarding
copy /Y NUL "\\BOB\onboarding\.writable" 
IF %ERRORLEVEL%==0 ( 
    del \\BOB\onboarding\.writable
    GOTO:ALLOWEDONBOARDING
 ) 

GOTO:SECT3
:ALLOWEDONBOARDING
net use m: /delete
net use m: \\BOB\onboarding 
:SECT3

::Etc,etc,etc

Basic explanation: It checks to see if a folder is writeable first by coping a blank file .writable, if it succeeds it executes the command, if it fails it skips the command and continues on.

This is purely a workaround....


Extending Mattisdada's answer, this script will make it a bit easier to modify any drive mappings by simply adding, deleting or changing the mapDrive function calls. Additionally, this function checks for read access by calling DIR (instead of writing the temp file) and maps accordingly:

@ECHO off

setlocal
set SHARE=BOB
CALL:mapDrive K: helpdesk
CALL:mapDrive M: onboarding
CALL:mapDrive Z: watercooler
endlocal

net use
ECHO Mapping Complete. Thank You.
PAUSE&GOTO:EOF

:mapDrive
DIR \\%SHARE%\%~2 > nul 2>&1
IF %ERRORLEVEL%==0 ( 
    net use %~1 /DELETE > nul 2>&1
    net use %~1 \\%SHARE%\%~2
)
GOTO:eof

I seem to have figured this out on my end, I just enter a password as an argument of net use, after the folder to be mapped, as below:

.. net use t: \BOB\helpdesk password /PERSISTENT:NO

not exactly sure why it works, as its not the right password for the user but it seems to map it anyway if the user has access and just throw an access denied if no access to drive and moves on :)