IT Knowledge Base

Technical Repository

HowTo: Running logon script from mapped drive

By default you cannot run a bat file from a network share, UNC paths are not supported. To get this to work, you would run pushd and popd. This will map out a temporary drive letter so that the bat commands will be able to run off the ‘mapped’ share and then the connection will be removed. This script copies a list of IE favorites from the network location to the users Favorites folder. This allows the admin to manage end users favorites by add/removing files from the shared folder which means they don’t have to modify the GPO any more.

pushd \\mydomain.local\SysVol
cd mydomain.local\Policies\{44BD7A60-FC96-4CCC-A780-F9A54568AFFC}\User\Scripts\Logon\IE_Favorites
xcopy * /E /Y /Q %UserProfile%\Favorites

Leave a Reply