-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathShared Servicesv2.bat
More file actions
29 lines (18 loc) · 1.05 KB
/
Copy pathShared Servicesv2.bat
File metadata and controls
29 lines (18 loc) · 1.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
@echo off
setlocal enabledelayedexpansion
:: Default Egnyte username is the Windows username
set EGNYTE_USER=%USERNAME%
:: --- EXCEPTION LIST START ---
:: Check for specific user/computer combinations and override the Egnyte username
if /I "%USERNAME%"=="jsmith" if /I "%COMPUTERNAME%"=="LAPT-FIN-01" set EGNYTE_USER=jsmith2
if /I "%USERNAME%"=="jsmith" if /I "%COMPUTERNAME%"=="DESK-ACC-05" set EGNYTE_USER=john.smith
if /I "%USERNAME%"=="mchen" if /I "%COMPUTERNAME%"=="LAPT-HR-12" set EGNYTE_USER=mchen_hr
:: --- EXCEPTION LIST END ---
:: --- SCRIPT EXECUTION ---
echo Mapping drive for Egnyte user: !EGNYTE_USER!
cd "C:\Program Files (x86)\Egnyte Connect"
:: The -d "ashleyvance" part might need to be dynamic too, but based on the original script we'll keep it static.
:: Note the use of !EGNYTE_USER! instead of %EGNYTE_USER% because of delayed expansion.
EgnyteClient.exe -command add -l "Private" -d "ashleyvance" -sso use_sso -t P -m "/Private/!EGNYTE_USER!" -c connect_immediately
:: You would do the same for your other drive mappings if needed
endlocal