Re: net use script issue with terminal server and DFS



Great Guys!

So i've removed "1>NUL: 2>&1" and this is the error message:
--------
C:\WINDOWS\Application Compatibility Scripts>Net Use Z: /D
There are open files and/or incomplete directory searches pending on the
connection to Z:.

do you want to continue the disconnection and abnormal termination ? (Y/N)
[N]:
(this is an italian S.O., so i translate the message)
------------
if i reply Y or N the window close and the user can work...but which is the
file open?!?

this is the complete script running text:
--------------------------
Z:\>rem @Echo Off

Z:\>Call "C:\WINDOWS\Application Compatibility Scripts\SetPaths.Cmd"

Z:\>REM ###############################################################

Z:\>REM # #

Z:\>REM # SetPaths #

Z:\>REM # #

Z:\>REM # Extracts the following paths into environment variables, #

Z:\>REM # allowing the scripts to run without hardcoded system path #

Z:\>REM # strings. This allows the scripts to run independently of #

Z:\>REM # system language. #

Z:\>REM # #

Z:\>REM # All Users:Startup COMMON_STARTUP #

Z:\>REM # All Users:Start Menu COMMON_START_MENU #

Z:\>REM # All Users:Start Menu\Programs COMMON_PROGRAMS #

Z:\>REM # Current User:Start Menu USER_START_MENU #

Z:\>REM # Current User:Startup USER_STARTUP #

Z:\>REM # Current User:Start Menu\Programs USER_PROGRAMS #

Z:\>REM # Current User:My Documents MY_DOCUMENTS #

Z:\>REM # Current User:Templates TEMPLATES #

Z:\>REM # Current User:Application Data APP_DATA

Z:\>REM # #

Z:\>REM ###############################################################

Z:\>REM ###############################################################

Z:\>REM # Use the GETPATHS option to set all of the environment variables

Z:\>REM ###############################################################

Z:\>"C:\WINDOWS\Application Compatibility Scripts\ACRegL.exe"
"E:\DOCUME~1\GRAZI
O~1\IMPOST~1\Temp\3\getpaths.cmd" COMMON_PATHS "HKLM\Software" "" GETPATHS

Z:\>If Not ErrorLevel 1 Goto Cont1

Z:\>Call "E:\DOCUME~1\GRAZIO~1\IMPOST~1\Temp\3\getpaths.cmd"

Z:\>SET COMMON_START_MENU=E:\Documents and Settings\All Users\Menu Avvio

Z:\>SET COMMON_STARTUP=E:\Documents and Settings\All Users\Menu
Avvio\Programmi\
Esecuzione automatica

Z:\>SET COMMON_PROGRAMS=E:\Documents and Settings\All Users\Menu
Avvio\Programmi


Z:\>SET USER_START_MENU=E:\Documents and Settings\graziolil\Menu Avvio

Z:\>SET USER_STARTUP=E:\Documents and Settings\graziolil\Menu
Avvio\Programmi\Es
ecuzione automatica

Z:\>SET USER_PROGRAMS=E:\Documents and Settings\graziolil\Menu Avvio\Programmi

Z:\>SET MY_DOCUMENTS=Documenti

Z:\>SET TEMPLATES=Modelli

Z:\>SET APP_DATA=Dati applicazioni

Z:\>Del "E:\DOCUME~1\GRAZIO~1\IMPOST~1\Temp\3\getpaths.cmd" 1>Nul: 2>&1

Z:\>REM If the values below are correct, execution has succeeded

Z:\>REM COMMON_START_MENU = E:\Documents and Settings\All Users\Menu
Avv
io

Z:\>REM COMMON_STARTUP = E:\Documents and Settings\All Users\Menu
Avvio\
Programmi\Esecuzione automatica

Z:\>REM COMMON_PROGRAMS = E:\Documents and Settings\All Users\Menu
Avvio
\Programmi

Z:\>REM USER_START_MENU = E:\Documents and Settings\graziolil\Menu
Avvio


Z:\>REM USER_STARTUP = E:\Documents and Settings\graziolil\Menu
Avvio\Pr
ogrammi\Esecuzione automatica

Z:\>REM USER_PROGRAMS = E:\Documents and Settings\graziolil\Menu
Avvio\P
rogrammi

Z:\>REM MY_DOCUMENTS = Documenti

Z:\>REM TEMPLATES = Modelli

Z:\>REM APP_DATA= Dati applicazioni

Z:\>Set _SetPaths=SUCCEED

Z:\>Goto Done

Z:\>If "SUCCEED" == "FAIL" Goto Done

Z:\>Rem

Z:\>Rem This is for those scripts that don't need the RootDrive.

Z:\>Rem

Z:\>If Not Exist "C:\WINDOWS\System32\Usrlogn1.cmd" Goto cont0

Z:\>Rem

Z:\>Rem Determine the user's home directory drive letter. If this isn't

Z:\>Rem set, exit.

Z:\>Rem

Z:\>Cd /d C:\WINDOWS\"Application Compatibility Scripts"

C:\WINDOWS\Application Compatibility Scripts>Call RootDrv.Cmd

C:\WINDOWS\Application Compatibility Scripts>If Exist
"C:\WINDOWS\Application Co
mpatibility Scripts\RootDrv2.Cmd" Call "C:\WINDOWS\Application Compatibility
Scr
ipts\RootDrv2.Cmd"


C:\WINDOWS\Application Compatibility Scripts>REM

C:\WINDOWS\Application Compatibility Scripts>Set RootDrive=Z:

C:\WINDOWS\Application Compatibility Scripts>If "AZ:A" == "AA" End.Cmd

C:\WINDOWS\Application Compatibility Scripts>Rem

C:\WINDOWS\Application Compatibility Scripts>Rem Map the User's Home
Directory t
o a Drive Letter

C:\WINDOWS\Application Compatibility Scripts>Rem

C:\WINDOWS\Application Compatibility Scripts>Net Use Z: /D
There are open files and/or incomplete directory searches pending on the
connection to Z:.

do you want to continue the disconnection and abnormal termination ? (Y/N)
[N]:

-------------------------

.