-Matthew-
asked on
VB Login Script
I need to convert this over to vbscript and fix a few things on the way. The main one, I need to stop the errors that come up when a drive is already mapped. Would it better to check for the drives existence or remove it then replace it?
I'm using this as an add on file that runs when connected to the vpn after connect.
I'm using this as an add on file that runs when connected to the vpn after connect.
@echo off
net use h: \\tsc72\%username%$
net use t: \\tsc73\collab$
ifmember "TSC\AEStaff"
if not %errorlevel% EQU 1 goto Endaestaff
echo Now mapping Z for the Domain Admins group..
net use s: \\tsc73\baehare$
:Endaestaff
ifmember "TSC\BCStaff"
if not %errorlevel% EQU 1 goto Endbcstaff
echo Now mapping Z for the Domain Admins group..
net use s: \\tsc73\bcshare$
:Endbcstaff
ifmember "TSC\BEStaff"
if not %errorlevel% EQU 1 goto Endbestaff
echo Now mapping Z for the Domain Admins group..
net use s: \\tsc73\beshare$
:Endbestaff
ifmember "TSC\BMStaff"
if not %errorlevel% EQU 1 goto Endbmstaff
echo Now mapping Z for the Domain Admins group..
net use s: \\tsc73\bmshare$
:Endbmstaff
ifmember "TSC\CEStaff"
if not %errorlevel% EQU 1 goto Endcestaff
echo Now mapping Z for the Domain Admins group..
net use s: \\tsc73\ceshare$
:Endcestaff
ifmember "TSC\COStaff"
if not %errorlevel% EQU 1 goto Endcostaff
echo Now mapping Z for the Domain Admins group..
net use s: \\tsc73\coshare$
:Endcostaff
ifmember "TSC\ITStaff"
if not %errorlevel% EQU 1 goto Enditstaff
echo Now mapping Z for the Domain Admins group..
net use n: \\tsc73\itshare$
net use k: \\tsc73\itadmin$
:Enditstaff
ifmember "TSC\DEStaff"
if not %errorlevel% EQU 1 goto Enddestaff
echo Now mapping Z for the Domain Admins group..
net use s: \\tsc73\deshare$
:Enddestaff
ifmember "TSC\ETStaff"
if not %errorlevel% EQU 1 goto Endetstaff
echo Now mapping Z for the Domain Admins group..
net use s: \\tsc73\etshare$
:Endetstaff
ifmember "TSC\HEStaff"
if not %errorlevel% EQU 1 goto Endhestaff
echo Now mapping Z for the Domain Admins group..
net use s: \\tsc73\heshare$
:Endhestaff
ifmember "TSC\HHStaff"
if not %errorlevel% EQU 1 goto Endhhstaff
echo Now mapping Z for the Domain Admins group..
net use s: \\tsc73\hhshare$
:Endhhstaff
ifmember "TSC\KEStaff"
if not %errorlevel% EQU 1 goto Endkestaff
echo Now mapping Z for the Domain Admins group..
net use s: \\tsc73\keshare$
:Endkestaff
ifmember "TSC\KMStaff"
if not %errorlevel% EQU 1 goto Endkmstaff
echo Now mapping Z for the Domain Admins group..
net use s: \\tsc73\kmshare$
:Endkmstaff
ifmember "TSC\MCStaff"
if not %errorlevel% EQU 1 goto Endmcstaff
echo Now mapping Z for the Domain Admins group..
net use s: \\tsc73\mcshare$
:Endmcstaff
ifmember "TSC\MEStaff"
if not %errorlevel% EQU 1 goto Endmestaff
echo Now mapping Z for the Domain Admins group..
net use s: \\tsc73\meshare$
:Endmestaff
ifmember "TSC\MMStaff"
if not %errorlevel% EQU 1 goto Endmmstaff
echo Now mapping Z for the Domain Admins group..
net use s: \\tsc73\mmshare$
:Endmmstaff
ifmember "TSC\OCStaff"
if not %errorlevel% EQU 1 goto Endocstaff
echo Now mapping Z for the Domain Admins group..
net use s: \\tsc73\ocshare$
:Endocstaff
ifmember "TSC\SWStaff"
if not %errorlevel% EQU 1 goto Endswstaff
echo Now mapping Z for the Domain Admins group..
net use s: \\tsc73\swshare$
:Endswstaff
ifmember "TSC\TransStaff"
if not %errorlevel% EQU 1 goto Endtransstaff
echo Now mapping Z for the Domain Admins group..
net use s: \\tsc73\transportation$
:Endtransstaff
ifmember "TSC\WEStaff"
if not %errorlevel% EQU 1 goto Endwestaff
echo Now mapping Z for the Domain Admins group..
net use s: \\tsc73\weshare$
:Endwestaff
ifmember "TSC\WMStaff"
if not %errorlevel% EQU 1 goto Endwmstaff
echo Now mapping Z for the Domain Admins group..
net use s: \\tsc73\wmshare$
:Endwmstaff
ifmember "TSC\WRStaff"
if not %errorlevel% EQU 1 goto Endwrstaff
echo Now mapping Z for the Domain Admins group..
net use s: \\tsc73\wrshare$
:Endwrstaff
ifmember "TSC\WWStaff"
if not %errorlevel% EQU 1 goto Endwwstaff
echo Now mapping Z for the Domain Admins group..
net use s: \\tsc73\wwshare$
:Endwwstaff
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
did this work for you? Please let me know if you need anything else.
Open in new window