'net use' , mapping network drive without stored credentials

is it possible to map a drive in the batch file without haveing to use the password in the command net use w: \\(server)\lantalk password:***** \user:***** is it possible to use the stored password within the server

1

2 Answers

is it possible to map a drive in the batch file without haveing to use the password in the command

Yes. I do this all the time on a shared network of Windows PCs where the computers have a common authentication arrangement or just trust each other. I find it is normally more convenient to create persistent connections than to run batch files though. Perhaps there are other use cases where a batch file would be useful.

is it possible to use the stored password within the server

No. Not in the sense I suspect you mean. People who create security arrangements intend that they cannot be trivially bypassed.

1

You can ask for username and password while the .bat is running, withou saving them in the .bat file.

example:

set /p username=Insert username:
set /p password=Insert password:
echo =======================================
net use Z: /delete
net use Z: \\server.yourdomain.local\shared-folder %password% /user:yourdomain\%username%

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like