Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

How to run net use with multiple lines of input( at once)?

my batch currently asking for an input for one line of net use command, and then it pauses and asks for another line of input.

My goal would be, that if i copy+paste 10 or 20 lines of directory names separated with an Enter, then it does each line and then i would have 10 or 20 attached network drive.

I couldn’t find anything which can help me or i am not sure what to look for exactly.

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

Is it even possible?

@echo off
cls
:start
set /p Input=Enter shared directory name: 
net use * \\%Input%\directory /USER:someuser Somepassword
pause
goto start

>Solution :

Try removing the pause:

@echo off
cls
:start
set /p Input=Enter shared directory name: 
net use * \\%Input%\directory /USER:someuser Somepassword
goto start
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading