I’m running into some strange behavior when trying to map an intranet URL to a drive letter.
For instance, variable-less command like such works fine with no issues:
Code: Select all
IF EXIST X:\ NET USE X: /delete
NET USE X: "http://tiger.client.com/organization/ccofinance/financesscandsystems/finance_systems/MDM/MDM Hierarchies" /USER:MPI\ServiceAccount Password
Code: Select all
FOR %%D IN ( b e f g h i j k l m o p q r s t u v w x y z ) DO (
IF NOT EXIST "%%D:\" (
SET "DL=%%D:"
GOTO BREAK
)
)
:BREAK
NET USE "%DL%" "%RDF_HORIZON_URL%" /USER:%SERVICEACCOUNT% >nul 2>&1 && (
ECHO Successful : Intranet URL Mapped as Drive >>%LOGFILE%
) || (
ECHO Failed : Intranet URL Mapped as Drive >>%LOGFILE%
GOTO AbnormalExit
)
pause
Does anyone have any ideas? Thanks!