Jump to content
Sign in to follow this  
jfcby

Map Network Drive

Recommended Posts

jfcby

Hello,

Operating System: WinXP SP2

AutoIT3 Version: 3.2.12.1

I'm trying to map my network drive so that when I restart my computer it will reconnect at login. From the help file I've used the flag 0, 1, and 8 then I tried combining them 0 & 1 and 0+1, did not work. But, unsuccessful with these attempts:

1. tried re-mapping the drive and restarting pc:

; Map drive
DriveMapAdd("Z:", "\\server\share", 1, "username", "password")

; Get details of the mapping
MsgBox(0, "Drive Z: is mapped to", DriveMapGet("Z:"))

2. tried deleting then re-mapping drive and restarting pc:

; Disconnect
DriveMapDel("Z:")

; Map drive 
DriveMapAdd("Z:", "\\server\share", 1, "username", "password")

; Get details of the mapping
MsgBox(0, "Drive Z: is mapped to", DriveMapGet("Z:"))

Thank you for your help,

jfcby

Edited by jfcby

Determined -- Devoted -- Delivered Make your mind up -- to seriously apply yourself -- accomplishing the desired results. **** A soft answer turneth away wrath: but grievous words stir up anger. Proverbs 15:1 KJB ****

Share this post


Link to post
Share on other sites
jfcby

Hello,

Operating System: WinXP SP2

AutoIT3 Version: 3.2.12.1

I'm trying to map my network drive so that when I restart my computer it will reconnect at login. From the help file I've used the flag 0, 1, and 8 then I tried combining them 0 & 1 and 0+1, did not work. But, unsuccessful with these attempts:

1. tried re-mapping the drive and restarting pc:

; Map drive
DriveMapAdd("Z:", "\\server\share", 1, "username", "password")

; Get details of the mapping
MsgBox(0, "Drive Z: is mapped to", DriveMapGet("Z:"))

2. tried deleting then re-mapping drive and restarting pc:

; Disconnect
DriveMapDel("Z:")

; Map drive 
DriveMapAdd("Z:", "\\server\share", 1, "username", "password")

; Get details of the mapping
MsgBox(0, "Drive Z: is mapped to", DriveMapGet("Z:"))

Thank you for your help,

jfcby

I want the same results as if you used Windows Explorer Tools > Map Net Work Drive > and check the Reconnect at login. I understand that there are several examples in the Forum but I have not found any that work. In the help file the 1 = Persistent mapping and suppose to be the same as checking the Reconnect at login but was wondering why my above script is not working?

Thank you for your help,

jfcby


Determined -- Devoted -- Delivered Make your mind up -- to seriously apply yourself -- accomplishing the desired results. **** A soft answer turneth away wrath: but grievous words stir up anger. Proverbs 15:1 KJB ****

Share this post


Link to post
Share on other sites
raj2734

When in doubt go back to dos

CODE
#include <Process.au3>

_RunDOS('NET USE Z: \\server\share password /Persistent:Yes /User:user')

Share this post


Link to post
Share on other sites
Richard Robertson

You do realize it's not really DOS, right?

Share this post


Link to post
Share on other sites
raj2734

You do realize it's not really DOS, right?

Yeah.. that was dumb on my part. Anyways what I put should work. Perhaps the function should have been _RunCmd(). Oh well.

Share this post


Link to post
Share on other sites
Richard Robertson

Yeah. I dunno who decided to name it that way.

Share this post


Link to post
Share on other sites
trancexx

The name of the function is _RunDos() because it's primarily use is to execute DOS commands.

That is kind of obvious... unlike your question.


♡♡♡

.

eMyvnE

Share this post


Link to post
Share on other sites
Richard Robertson

They aren't DOS commands though. They are passed to the system's command interpreter. Since the dev team dropped 9x (and only the 9x systems had DOS), then none of the commands are DOS. They only look like DOS.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×