• August 13, 2020, 01:56:00 PM
  • Welcome, Guest
Please login or register.

Login with username, password and session length
Advanced search  

News:

This Forum Beta is ONLY for registered owners of D-Link products in the USA for which we have created boards at this time.

Author Topic: Sample Script to Map Drive on Windows Machines  (Read 3209 times)

vreid47362

  • Level 1 Member
  • *
  • Posts: 15
    • Vaughn's Computer House Calls
Sample Script to Map Drive on Windows Machines
« on: December 30, 2008, 05:23:09 AM »

Below is a sample script that I use on my network to map drives for users to the D-Link DNS-343.  Items in braces require input to customize the script to your network environment.  Save this file with an extension of .bat to make it executable.  On my network, I have shares for each user, a shared folder for everyone, a shared calendar share, and a share of downloads, etc.  The script asks the user for his/her DNS-343 username and password and then passes that to the net use statements for authentication and to find the correct user folder on the NAS.

@echo off
color 18
cls
set device=[Enter the Device IP or internal DNS name here]
@echo Please enter the following network information
echo.
set /p user=Please enter your network username:
set /p pass=Please enter your network password:
echo.
@echo mapping drives on nas device
echo.
net use h: \\%device%\%user% /user:%user% %pass% /persistent:no
net use p: \\%device%\shared /user:%user% %pass% /persistent:no
net use q: \\%device%\calendars /user:%user% %pass% /persistent:no
net use r: \\%device%\downloads /user:%user% %pass% /persistent:no
pause
exit
« Last Edit: December 30, 2008, 05:26:50 AM by vreid47362 »
Logged

hilaireg

  • Level 3 Member
  • ***
  • Posts: 347
Re: Sample Script to Map Drive on Windows Machines
« Reply #1 on: December 30, 2008, 09:58:19 AM »

Very slick ... thanks for sharing  :)
Logged