i have created batch file to copy files from network drive to local.
.bat file:
SET username=%1
SET password=%2
net use "\\gesvij\toys\names" %password% /user:shop\%username%
:copy
Xcopy "\\gesvij\toys\names" "%appdata%\Microsoft\Templates" /S /E
IF ERRORLEVEL 0 goto disconnect
goto end
:disconnect
net use "\\gesvij\toys\names" /delete
goto end
:end
i have tried the following code to execute the batch file in vba.
sub ok_click
dim un as string
dim pd as string
un = " " + un_text.value
pd = " " + pd_text.value
call shell("\\gesvij\toys\names\test.bat & un & pd")
end sub
now i have following question:
1) the batch file is not running properly from vba code. but the bat file is working properly when i run independently. 2) once the file copied in the local how do i disconnect the network path "\gesvij\toys\names" in the batch file
anyone please on this ?