T.J.
asked on
Simple Script to Map Drives
I'm setting up a laptop to connect to a server I have here that's on a domain. This machine is not part of the domain. Every time this person comes here they need to reconnect to the drive, enter username and password to connect to the share.
Here is what I am looking to do, I have very little coding experience, but I want to place an icon on the desktop or somewhere on the laptop that when clicked will automatically map to the needed share, enter the username/password, and be simple to integrate.
Nothing to complex, probabaly something with a net use command.
Thanks for the help!
Here is what I am looking to do, I have very little coding experience, but I want to place an icon on the desktop or somewhere on the laptop that when clicked will automatically map to the needed share, enter the username/password, and be simple to integrate.
Nothing to complex, probabaly something with a net use command.
Thanks for the help!
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Worked like a charm - thanks!
Out of curiosity...
You know when you map a net drive in windows and there is a checkbox that asks if you want to reconnect at logon? Is there a way to integrate that into this script so that the next time the laptop is turned on, and there is no connection to THIS network it does not pop up and ask that question it asks when it cannot find a previous mapped drive?
Out of curiosity...
You know when you map a net drive in windows and there is a checkbox that asks if you want to reconnect at logon? Is there a way to integrate that into this script so that the next time the laptop is turned on, and there is no connection to THIS network it does not pop up and ask that question it asks when it cannot find a previous mapped drive?
Thank You!
Yes thats called a persistent connection, and you can integrate that into the script, just do the following:
REM ************************** ********** ********** **
@echo off
echo This Drive maps your Network Drive and uses Drive letter M:
net use M: /d yes
net use M: \\serrvernamehere\sharenam ehere /persistent:Yes /user:theusernamehere theuserpasswordhere
echo Drive mapping complete
REM ************************** ********** ********** **
Yes thats called a persistent connection, and you can integrate that into the script, just do the following:
REM **************************
@echo off
echo This Drive maps your Network Drive and uses Drive letter M:
net use M: /d yes
net use M: \\serrvernamehere\sharenam
echo Drive mapping complete
REM **************************
ASKER
Hey folks, wonder if I could touch base on this topic again.
Heres my script:
REM ************************** ********** ********** **
@echo off
echo This Drive maps your Network Drive and uses Drive letter F:
net use F: /d yes
net use F: \\server\sys$\Apps\Account ing\PeachT ree-Accoun ting-STI /user:domain.com\firstname .lastname password
echo Drive mapping complete
REM ************************** ********** ********** **
I get the error: "A command was used with conflicting switches."
Any suggestions? Do you think I should just re-open this issue as a NEW QUESTION here?
Heres my script:
REM **************************
@echo off
echo This Drive maps your Network Drive and uses Drive letter F:
net use F: /d yes
net use F: \\server\sys$\Apps\Account
echo Drive mapping complete
REM **************************
I get the error: "A command was used with conflicting switches."
Any suggestions? Do you think I should just re-open this issue as a NEW QUESTION here?
You can use the following script. Copy paste in notepad, and save file as MapDrive.Bat on the Desktop.
REM **************************
@echo off
echo This Drive maps your Network Drive and uses Drive letter M:
net use M: /d yes
net use M: \\serrvernamehere\sharenam
echo Drive mapping complete
REM **************************
Thanks and Good Luck!