A lire aussi:

Un livre sur TSE ?

Bannière
RootDrive inaccessible. PDF Imprimer Envoyer
Note des utilisateurs: / 0
MauvaisTrès bien 
Écrit par Renaud DEVERS   
Vendredi, 29 Juillet 2005 13:22

Petit cas d'ecole classic sous Metaframe:

 

  • Hypothese:
    • Mon disque systeme est M:\
    • Mon disque data est N:\
    • Les HomeDirectory sont sur \\srvhome\home
    • Les HomeDirectory sont mapper sur K:\
    • Mon RootDrive est c:\
    • Je remappe par Citrix les disques locaux. c$ --> v: ...
    • J'ai une application HardCoded qui va chercher sa conf dans: {c:\monappli\monappli.ini}
    • Sous W2K SP3 tous va bien.
  • Test:
    • je lance mon appli
    • crt+F3
    • new task
    • cmd.exe
ctrl+F3 puis cmd.exe
Microsoft Windows 2000 [Version 5.00.2195]
(C) Copyright 1985-2000 Microsoft Corp.

K:\>subst
C:\: => K:\

K:\>dir c:
The filename, directory name, or volume label syntax is incorrect.

K:\>net use
New connections will be remembered.


Status       Local     Remote                    Network

-------------------------------------------------------------------------------
OK           K:        \\srvhome\home\chavers  Microsoft Windows Network
             V:        \\Client\C$               Client Network
             Y:        \\Client\C$               Client Network

The command completed successfully.


K:\>dir c:
The filename, directory name, or volume label syntax is incorrect.

K:\>subst c: /d
Access denied - C:

K:\>set h
HOMEDRIVE=K:
HOMEPATH=\
HOMESHARE=\\srvhome\home\chavers

K:\>subst e: %HOMEDRIVE%%HOMEPATH%

K:\>dir e:
 Volume in drive E is Home
 Volume Serial Number is C81C-08FD

 Directory of E:\

28/07/2005  16:27       <DIR>          .
28/07/2005  16:27       <DIR>          ..
29/09/2004  21:16       <DIR>          bonus
27/05/2003  17:44               45 056 client.exe
27/08/2004  12:20                  105 clntnfo.ini
(...)
12/07/2005  10:41       <DIR>          WINDOWS
              12 File(s)        335 268 bytes
               8 Dir(s)     520 622 080 bytes free

 

 

  • Constat:
    • Mon rootdrive est bien monté.
    • Je n'y est pas acces.
    • Mes connections réseaux sont bonnes.
    • Je ne peux pas démonter mon RootDrive.
    • J'ai un %HOMESHARE%.
    • Si je recré un subst, il fonctionne.

Bref c'est pas tres logique, ca sent le bug! Le probleme c'est que ca continue à fonctionner pour les utilisateurs qui n'ons pas de HomeDrive réseaux ex: l'admin local.

  •   Solution (c'est la mienne, si vous avez mieux il y a le Forum)
    • Editer le usrlogon.cmd pour vérifier la présence de la variable HOMESHARE et effectuer un net use a la place du subst.
usrlogon.cmd
@Echo Off

Call "%SystemRoot%\Application Compatibility Scripts\SetPaths.Cmd"
echo 0
If "%_SETPATHS%" == "FAIL" Goto Done
echo 1
Rem
Rem This is for those scripts that don't need the RootDrive.
Rem

If Not Exist "%SystemRoot%\System32\Usrlogn1.cmd" Goto cont0
Cd /d "%SystemRoot%\Application Compatibility Scripts\Logon"
Call "%SystemRoot%\System32\Usrlogn1.cmd"
echo 2
:cont0

Rem
Rem Determine the user's home directory drive letter.  If this isn't
Rem set, exit.
Rem

Cd /d %SystemRoot%\"Application Compatibility Scripts"
Call RootDrv.Cmd
If "A%RootDrive%A" == "AA" End.Cmd
echo 3
Rem
Rem Map the User's Home Directory to a Drive Letter
Rem

IF NOT "A%HOMESHARE%A" == "AA" goto HOMESHARE
Net Use %RootDrive% /D >NUL: 2>&1
Subst %RootDrive% "%HomeDrive%%HomePath%"
if ERRORLEVEL 1 goto SubstErr
goto AfterSubst
echo 4
:SubstErr
Subst %RootDrive% /d >NUL: 2>&1
Subst %RootDrive% "%HomeDrive%%HomePath%"
:AfterSubst
GOTO ENDHOMESHARE
echo 5

:HOMESHARE
  Net Use %RootDrive% /D >NUL: 2>&1
  Subst %RootDrive% /d >NUL: 2>&1
  net use %RootDrive% %HOMESHARE%
:ENDHOMESHARE
Rem
Rem Invoke each Application Script.  Application Scripts are automatically
Rem added to UsrLogn2.Cmd when the Installation script is run.
Rem

If Not Exist %SystemRoot%\System32\UsrLogn2.Cmd Goto Cont1
echo 6
Cd Logon
Call %SystemRoot%\System32\UsrLogn2.Cmd

:Cont1

:Done

 

 

Commentaires
Ajouter un nouveau Rechercher
Ecrire un commentaire
Nom:
Email:
 
Titre:
 
:angry::0:confused::cheer:B):evil::silly::dry::lol::kiss::D:pinch:
:(:shock::X:side::):P:unsure::woohoo::huh::whistle:;):s
:!::?::idea::arrow:
 
Saisissez le code que vous voyez.

3.26 Copyright (C) 2008 Compojoom.com / Copyright (C) 2007 Alain Georgette / Copyright (C) 2006 Frantisek Hliva. All rights reserved."

Mis à jour le Vendredi, 14 Mars 2008 21:49