Jump to content

Mapped Drive


Recommended Posts

hey guys & gals

so I am completely new to AutoIt

struggling with something

I wanted to map a network drive and googled and found this forum and some examples and have written 

DriveMapAdd("Z:", "\\network path here", "domain\username", "password")

This runs without error - however an actual Z drive never actually appears in my computer

Am I missing something ?

 

I have reboot - ran the script again - same deal

Appreciate the help!

Link to comment
Share on other sites

Hey willichan

 

This is the code I am using in my file

 

DriveMapAdd("Z:", "\\network path here", "domain\username", "password")

 

Obvious with the network path being the actual network path and the domain username and password being changed to the real information

Link to comment
Share on other sites

It will be very difficult to figure out what the problem is with so little information.

Is your network path in the format of "\\servername\share"?

Are you mapping the drive as the currently logged in user or as a different user?

What kind of network are you on?  Are you on a domain?

Link to comment
Share on other sites

Hello!

A) For Windows7, add this to your registry:

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System]
"EnableLinkedConnections"=dword:00000001

B) Try assigning your command to a VARIABLE, like this:

$DriveZ = DriveMapAdd("Z:", "\\network path here", "domain\username", "password")

vbr Rolf

Link to comment
Share on other sites

I tried this yesterday on my Windows 7 workstation and got the same situation when I provided the credentials like in the original post.  Leaving the credentials out, the command worked fine.  I MsgBox'ed the error code and @error = 1

Link to comment
Share on other sites

Thank You MuffinMan - love the handle

 

willichan

sorry about that - I am on a domain - the network path is a shared folder on a server - not another users system 

 

Is your network path in the format of "\\servername\share"? Yes this is what the path looks like 

Are you mapping the drive as the currently logged in user or as a different user? I am mapping the drive to the currently logged in user - in this case it;s the same as the credentials I am providing in the script

What kind of network are you on?  I am on corporate network 

Are you on a domain? Yes I am on a domain

If I right click my computer and select map network drive and provide the exact same path and my credentials - the drive maps without issue doing it the manual way

 

I'm wondering if my expectation of the function isn't correct - if using that function doesn't actually create a mapped drive - hope that makes sense

Link to comment
Share on other sites

If you're using the currently logged on user's credentials, have to tried the drivemapadd function without specifying the credentials?

Also, you are putting the username in the flags parameter and the password in the user parameter of the function, so no wonder it's not working for you. :)

 

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Link to comment
Share on other sites

Hey BrewManNH

 

I did try without the credentials and noticed I was using the username in the flags parameter

 

however when I change it to this

 

DriveMapAdd("Z:","\\server\folder\folder\",0)

 

It runs - now errors generated - however I still don't have a Z drive in my computer 

Link to comment
Share on other sites

Do you already have a Z: drive? I ran the command with local domain folders and with and without using my credentials and it works every time, Windows 7 Enterprise x64

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Link to comment
Share on other sites

Link to comment
Share on other sites

Good catch willichan, never even noticed the trailing backslash

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...