User Tools

Site Tools


faq:fixing_drive_disconnects_with_a_login_script

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
faq:fixing_drive_disconnects_with_a_login_script [2008/07/21 09:31 (16 years ago)] bobfaq:fixing_drive_disconnects_with_a_login_script [2009/02/11 09:02 (15 years ago)] (current) bob
Line 1: Line 1:
 ====== Fixing Drive Disconnects with a Login Script ====== ====== Fixing Drive Disconnects with a Login Script ======
 +**Figure 1:** **Sample of when W: drive is not mapped "Link a new workstation"**
  
-A disconnected drive to a server PC that contains System Five data will prompt the user to "Link a new workstation" when attempting to login to System Five from a client. If you ever experience drive disconnects when booting up a workstation PC, the following login script will help fix the problem:+{{faq:link.jpg|}}
  
 +A disconnected drive to a server PC that contains System Five data will prompt the user to "Link a new workstation" when attempting to login to System Five from a client. If you ever experience drive disconnects when booting up a workstation PC, the following login script will help fix the problem:
  
 +<code>
 @ECHO OFF @ECHO OFF
- 
 CLS CLS
-ECHO Logging onto network... please wait... +ECHO Logging onto network please wait 
-ECHO+ECHO
- +
 :NOTREADY :NOTREADY
- 
 REM Check that the workstation service has finished loading and is ready. REM Check that the workstation service has finished loading and is ready.
- 
 REM Loop until the service is ready. REM Loop until the service is ready.
- 
 NET STATISTICS WORKSTATION |FIND /I "completed successfully">NUL NET STATISTICS WORKSTATION |FIND /I "completed successfully">NUL
- 
 IF ERRORLEVEL 1 GOTO NOTREADY IF ERRORLEVEL 1 GOTO NOTREADY
- 
- 
 :CANPING :CANPING
- 
 REM Check that we can ping the server. REM Check that we can ping the server.
- 
 REM Exit if no reply is received. REM Exit if no reply is received.
- 
 PING SERVER2003 |FIND /I "reply from">NUL PING SERVER2003 |FIND /I "reply from">NUL
- 
 IF ERRORLEVEL 1 GOTO END IF ERRORLEVEL 1 GOTO END
 +:ATTACH
 +NET USE W: \\SERVER2003\WINDWARD /user:windward windward /PERSISTENT:NO
 +:END
 +</code>
  
 +The above script first verifies that the workstation service is started and that the server can be pinged from the workstation prior to attempting to map the drive. The server in this case is named **SERVER2003** and the share is named **WINDWARD**. Also, a user named **windward** with the password **windward** has been created on the server and drive W: is being mapped as that user. Save the above text in a file called login.bat and place it in the c:\windows folder on each PC. Then add it to the startup folder on the workstation so that it is executed when the PC boots up. **(See Figure 1)**
  
-:ATTACH+**Figure 2Sample of batch file in startup folder**
  
-NET USE W\\SERVER2003\WINDWARD windward /USER:windward /PERSISTENT:NO+{{faq:startup.jpg|}} 
  
 +**Figure 3: Sample of script running**
 +
 +{{faq:script.jpg|}}
 +
 +**Figure 4: Complete Script**
 +
 +{{faq:1-network-script.jpg|}}
  
-:END 
  
  
  
-The above script first verifies that the workstation service is started and that the server can be pinged from the workstation prior to attempting to map the drive. The server in this case is named **SERVER2003** and the share is named **WINDWARD**. Also, a user named **windward** with the password **windward** has been created on the server and drive W: is being mapped as that user. Save the above text in a file called login.bat and place it in the c:\windows folder on each PC. Then add it to the startup folder on the workstation so that it is executed when the PC boots up. 
faq/fixing_drive_disconnects_with_a_login_script.1216657914.txt.gz · Last modified: 2008/07/21 09:31 (16 years ago) by bob