• April 22, 2021, 06:15:17 AM
  • Welcome, Guest
Please login or register.

Login with username, password and session length
Advanced search  


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 3303 times)


  • 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
set device=[Enter the Device IP or internal DNS name here]
@echo Please enter the following network information
set /p user=Please enter your network username:
set /p pass=Please enter your network password:
@echo mapping drives on nas device
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
« Last Edit: December 30, 2008, 05:26:50 AM by vreid47362 »


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

Very slick ... thanks for sharing  :)