J
John
I am using the RASDIAL command in a batch file for users to connect to our
VPN, so it can also map the network drive. This works great, but I would
like to see if it can check for a valid connection to the internet (IP
address or other method) before executing the command, as I would like for
this batch file to be added to startup. All of these users travel, and
often work offline. Any suggestions or recommendations would be
appreciated.
Here is the current batch:
@echo off
rasdial "OurCompany VPN" /domain:domain_name
if errorlevel 1 goto finish_error
net use P: \\10.0.0.1\share_name /persistent:no
if errorlevel 1 goto finish_nomap
goto finish_noerror
:finish_error
echo There was an error completing your connection.
pause
goto exit_batch
:finish_nomap
echo You have connected to the VPN, but the connection to the mapped drive
could not be completed.
pause
goto exit_batch
:finish_noerror
echo You have been successfully connected.
pause
:exit_batch
VPN, so it can also map the network drive. This works great, but I would
like to see if it can check for a valid connection to the internet (IP
address or other method) before executing the command, as I would like for
this batch file to be added to startup. All of these users travel, and
often work offline. Any suggestions or recommendations would be
appreciated.
Here is the current batch:
@echo off
rasdial "OurCompany VPN" /domain:domain_name
if errorlevel 1 goto finish_error
net use P: \\10.0.0.1\share_name /persistent:no
if errorlevel 1 goto finish_nomap
goto finish_noerror
:finish_error
echo There was an error completing your connection.
pause
goto exit_batch
:finish_nomap
echo You have connected to the VPN, but the connection to the mapped drive
could not be completed.
pause
goto exit_batch
:finish_noerror
echo You have been successfully connected.
pause
:exit_batch