I want to run one batch script to run non-interactive method to connect other network shared drive.
But, i don't want to hard code the password in net use command.
Please suggest any other ways to connect network shared drive?
thanks.
You do not mention that you want the credential hidden, just that you do not want to hardcode them into the batch file so you can put the username and password in external file and then set the variable from reading these file.
set /p username=
net use x: \server\share /user:%username% %pass%
after that if you need to hide the password then you can put it in alternate stream of the file and read that from the script.