|
| |||||||||
| Tags: correctly, script |
![]() |
| | Thread Tools | Search this Thread |
|
#1
| |||
| |||
| Logon script not working correctly
I have a logon script I want to use on Small Business Server 2003 to map two network drives on the workstations. There are five servers on the network and I do not want drives mapped on these. There must be something wrong with my syntax because the servers always get their drives mapped. Any suggestions? @echo off rem check to see if a SBS member \\SERVER1\Clients\Setup\setup.exe /s SERVER1 rem rem check if server - skip drive mappings if server rem if %computername% == Server1 goto end if %computername% == AVPS3 goto end if %computername% == Avpserver1 goto end if %computername% == NAS goto end if %computername% == ERP goto end rem rem All client computers but server run these commands rem net time \\Server1 /set /y net use z: /d net use z: \\NAS\users\%username% net use y: /d net use y: \\nas\shared :end |
|
#2
| ||||
| ||||
| Re: Logon script not working correctly
You host needs to turn on Parent Pathing (which most won't). Your path is a parent path to the root /logon/_private/logon.inc Alternatively try setting it to a relative path (relative to you page) logon/_private/logon.inc
__________________ Education, Career and Job Discussions |
|
#3
| ||||
| ||||
| Re: Logon script not working correctly
You can do a WMI query against the Win32_NetworkConnection class to determine whether the drive is mapped before unmapping it. However, it might be simplest to just delete all network drives at the beginning. http://www.microsoft.com/technet/scr...5/hey0915.mspx |
|
#4
| ||||
| ||||
| Re: Logon script not working correctly
The script is correct. Just a cosmetic change need to be done. Just add /I in all the conditions for skipping drive mapping. This will solve the problem, as far as I think. Try it and let me now if that works. |
|
#5
| ||||
| ||||
| Re: Logon script not working correctly
I had used such kind of a script earlier but I dont remember the script now. To me, the script looks correct. I didn't understand what modifier is talking about /I. Modifier, can you please tell me where exactly to add this tag? |
|
#6
| ||||
| ||||
| Re: Logon script not working correctly Quote:
Code: @echo off rem check to see if a SBS member \\SERVER1\Clients\Setup\setup.exe /s SERVER1 rem rem check if server - skip drive mappings if server rem if /I %computername% == Server1 goto end if /I %computername% == AVPS3 goto end if /I %computername% == Avpserver1 goto end if /I %computername% == NAS goto end if /I %computername% == ERP goto end rem rem All client computers but server run these commands rem net time \\Server1 /set /y net use z: /d net use z: \\NAS\users\%username% net use y: /d net use y: \\nas\shared :end |
![]() |
|
| Thread Tools | Search this Thread |
| |
Similar Threads for: "Logon script not working correctly" | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Dumping logon name and logon script values to a text file - blank logon script field | Phil McNeill | Windows Server Help | 3 | 17-08-2010 10:06 PM |
| Script logon | Gianluca | Active Directory | 8 | 22-04-2010 09:48 PM |
| GP Logon Script works first time at second user logon | Roland Schoen | Active Directory | 2 | 09-11-2009 06:49 PM |
| help with logon vbs script | theunlikely@gmail.com | Windows Server Help | 4 | 19-03-2009 08:57 AM |
| Logon Script will not run | Absolutely | Windows Server Help | 5 | 29-01-2008 06:26 PM |