This tutorial will cover the following aspects:
How to deploy a logon script and have multiple logon scripts scenery.
Mounting a specific folder within a session from client or server side.
If you wish to publish a folder on a logical virtual drive for your users.
just follow this procedure:
Prior to creating the script, open windows explorer and click on “Folder and search options”.
![Mount A Logical Drive logical drive](https://tsplus.me/wp-content/uploads/2019/03/folder-search-options.png)
Then, click on the view tab and uncheck the box “Hide extensions for known types”:
![Mount A Logical Drive hide](https://tsplus.me/wp-content/uploads/2019/03/hide-extensions.png)
Create a text document and modify the extension by naming it “logon.bat”:
Inside the file, enter for example this command to publish the Folder.exe folder:
“subst Y: \tsclient\C\Users\%USERNAME%\Documents”
Then, on the start menu, type in gpedit.msc on the search taskbar. We are going to use local policy so that every user connecting to this server launches the script.
Go into the user’s configuration menu, then into the Windows settings, and finally, into Scripts (Logon/Logoff) Double click on the Logon script, then click on “Add”, then on “Browse”.
![Mount A Logical Drive logon bat3](https://tsplus.me/wp-content/uploads/2019/03/logon-bat3.png)
Then, click on “Show Files” button on the Logon Propeties window and copy your logon.bat script into the path given by the Policy Editor, i.e.: “C:\Windows\System32\GroupPolicy\User\Scripts\Logon”
![Mount A Logical Drive logon bat4](https://tsplus.me/wp-content/uploads/2019/03/logon-bat4.png)
- You can copy this logon.bat file in C:\ProgramData if you want this script to be executed for all of your users.
- If you need a specific logon script for each user then copy the script in C:\Users\Username\AppData\Roaming
Now how do we make this logical drive appear in the user session? There many ways to achieve this. You can create a new application within the admin tool and assign it to your users, doing so the shortcut will appear in the session:
![Mount A Logical Drive logical drive](https://tsplus.me/wp-content/uploads/2019/03/common-folder.png)
If you connect to a session with mstsc.exe, don’t forget to go to the options menu, and on the Local Resources tab, under Local devices and resources, click on “More”, then check the box “Drives”.
If you want to secure the access of a folder. See our documentation to publish a secured folder.