Monday, October 19, 2015

script windows map network drive

-----Script--------------------------------
@echo off

net use *  /delete /yes
net use s: \\172.16.0.xx\fileshare /user:abc password
-----End-------------------

net use s: /delete
net use  ---> show map drive

windows 10 Startup
goto -> run  -> shell:startup


Example script check Mapdrive

check-startup.bat

------

echo off

net use s: /delete /yes

net use y: /delete /yes

net use s: \\ip address\sharefile01

net use y: \\ip address\sharefile02

 

:redo

if exist s:\filename.txt goto ready  -> check have a file name filename.txt on drive S:

if not exist s:\filename.txt goto notready

goto end

 

:notready  loop check file

echo Not ready to access Drive S:

timeout /t 3

goto redo

 

:ready

echo Ready to access Drive S:

start s:   --> open drive s: on windows start up 


echo --------------------------

echo STARTING APP COMMANDS HERE

echo --------------------------

goto end

------

No comments: