This short script will map a drive letter to all the admin shares to a remote computer. My plan was to use this script when I use RDP (Remote Desktop Protocol) to access a computer from home. I will run this script and map all my home computer hard drives to the work computer. Now I can transfer files between the two locations, without using tricks like emailing the file to myself.
@echo off
Set /p LocalComputer=[What is the name of the local computer you want to map drives to?]
cls
Echo This script will map a network drive to all active drives on the laptop "%LocalComputer%".
Echo.
Echo Please share any drives you would like to access before running the script.
echo To share the drive:
echo. Right-click the drive from 'My Computer'
echo. Select Sharing and Security
echo. Select Share this drive
echo. Enter a share name of the drive letter ending with a '$'.
echo. For example: T$
Echo.
Echo These drives are currently accessible:
for /R \\%LocalComputer%\ %%a in (C D E F G H I J K L M N O P Q R S T U V W X Y Z ) do if exist %%a$ echo %%a$
echo.
echo Press CTRL+C to cancel this script
Pause
for /R \\%LocalComputer%\ %%a in (C D E F G H I J K L M N O P Q R S T U V W X Y Z ) do if exist %%a$ net use * %%a$
Comments
Post new comment