Hallo,
Ik heb al van alles afgezocht maar ik kom er niet uit.
Ook heb ik het in oud topic gepost maar geen reactie.
Dus vandaar dat ik het zo probeer
Ik heb windows Vista home premium , ik heb een vpn verbinding ingesteld maar er komt een rood kruis door de mappen dit probleem heb ik al meer gelezen, ik heb het script @echo van wizjos gebruikt.
De netwerk schijf van buiten af verdwijnt als het script op start.
Maar de schijf komt niet terug
Waar doe ik wat fout ?
Alvast super bedankt voor de hulp
@ECHO OFF
REM Edit by Wizjos 9/3/2013
REM !---- Command Script that waits until the network connection to a (local) network resource has been
REM !---- established, and only then mounts specified network locations as mapped drives.
REM !---- Useful in case setting up the network connection might take long following startup.
REM !---- This might e.g. apply to WiFi connections
REM !---- Script verified for WinXP (English version)
REM !---- Define the NAS IP-address or network name (e.g. "192.168.1.5" or "Diskstation"), but use -NO- quotes (")
REM !---- IP-address should always work; network name only when client and NAS are in the same Workgroup/Domain
SET nas_ip=10.9.0.6
REM !---- Use this section if NAS-username and/or -password differs from Windows-username and/or -password
REM !---- Omit this section ("REM" all lines) if Windows and NAS user-name and -password are identical
SET nas_usr=Heb ik in gevuld
REM !---- Use the next line to be prompted for the NAS-user password. Preferred solution, safe
REM SET /p nas_pwd=Please provide password for remote user %nas_usr% on \%nas_ip%: ?
REM !---- Use the next line to put the NAS-user password in this file. Non-preferred, unsafe
SET nas_pwd=heb ik ingevuld
REM !---- Modify the following variables according to need; value always between 1 and 254 (incl)
SET /a seconds_between_pings=3
SET /a max_attempts=90
SET /a seconds_of_end_message=10
SET /a min_good_pings=3
REM !---- Use the next line if you want to delete the links to ALL mapped network drives
NET USE * /DELETE
REM !---- Use the next line(s) (and modify drive-letters) if you want to delete specific mapped network drives
REM NET USE K: /DELETE
REM NET USE L: /DELETE
SET /a attempts=1
SET /a good_pings=0
SET display=Waiting for connection to %nas_ip% .
REM !--- Mind the white-space ( ) behind the last period (.) above !
:try_again
CLS
ECHO %display%
REM !--- The following line serves as a "wait" statement
PING -n %seconds_between_pings% -w 1 %nas_ip% >NUL
REM !--- You might (?) need to change "Reply from" below for non-English Windows versions
PING -n 1 -w 200 %nas_ip% | FIND "Antwoord van %nas_ip%" >NUL
IF %ERRORLEVEL% EQU 0 (SET /a good_pings+=1)
IF %good_pings% EQU %min_good_pings% GOTO :conn_established
SET display=%display:. =.. %
SET /a attempts+=1
IF %attempts% LEQ %max_attempts% GOTO :try_again
ECHO.
ECHO Connection to %nas_ip% failed to establish within reasonable time
ECHO.
ECHO Unable to map network drive(s) to %nas_ip%
ECHO.
GOTO :almost_oef
:conn_established
ECHO.
ECHO Connection to %nas_ip% established
ECHO.
ECHO Now mapping network drive(s)
IF N%nas_usr%==N (SET userdata="") ELSE (SET userdata="/USER:%nas_usr% %nas_pwd% ")
rem also OK for XP: IF defined nas_usr (SET userdata="/USER:%nas_usr% %nas_pwd% ") ELSE (SET userdata="")
rem not OK for XP: IF EXIST %%nas_usr%% (SET userdata="/USER:%nas_usr% %nas_pwd% ") ELSE (SET userdata="")
REM !---- add line(s), change drive-letter (e.g. K:) and NAS folder-name (e.g. nas_folder1) according to need
NET USE K: \%nas_ip%\homes %userdata:"=%/PERSISTENT:NO
:almost_oef
PING -n %seconds_of_end_message% -w 1 %nas_ip% >NUL