Jump to content

DriveMapAdd don't work


Recommended Posts

that works for me.

i advise you to verify that Windows does accept the share name you designate to it (because by default, Windows would share your folder by the name of the folder). to verify that, open the "Computer Management" (compmgmt.msc) and navigate to the "Shares" list.

of course, permissions may also be an issue.

one more thing to check: if you do not specify a drive letter, Windows may assign you a drive letter already in use by a removable device (e.g. USB drive). try to specify a drive letter that you know for a fact that is available.

 

Edited by orbs

Signature - my forum contributions:

Spoiler

UDF:

LFN - support for long file names (over 260 characters)

InputImpose - impose valid characters in an input control

TimeConvert - convert UTC to/from local time and/or reformat the string representation

AMF - accept multiple files from Windows Explorer context menu

DateDuration -  literal description of the difference between given dates

Apps:

Touch - set the "modified" timestamp of a file to current time

Show For Files - tray menu to show/hide files extensions, hidden & system files, and selection checkboxes

SPDiff - Single-Pane Text Diff

 

Link to comment
Share on other sites

first i advise you check the return value of your function, like this:

Global $xRet = DriveMapAdd("*", "\\" & @ComputerName & "\shared")
ConsoleWrite('return value = ' & $xRet & @CRLF & '@error value = ' & @error & @CRLF)

if you claim @error = 0, then i truly wonder what is the return value.

i will check on Windows 10 shortly (i'm on Windows 7).

 

Edited by orbs

Signature - my forum contributions:

Spoiler

UDF:

LFN - support for long file names (over 260 characters)

InputImpose - impose valid characters in an input control

TimeConvert - convert UTC to/from local time and/or reformat the string representation

AMF - accept multiple files from Windows Explorer context menu

DateDuration -  literal description of the difference between given dates

Apps:

Touch - set the "modified" timestamp of a file to current time

Show For Files - tray menu to show/hide files extensions, hidden & system files, and selection checkboxes

SPDiff - Single-Pane Text Diff

 

Link to comment
Share on other sites

works as expected for me on Windows 10.

retro-check:

you get a return value of empty string and @error value of 0?

your share appears on the "Shares" list with its name set to the name you specified ("shared")?

Signature - my forum contributions:

Spoiler

UDF:

LFN - support for long file names (over 260 characters)

InputImpose - impose valid characters in an input control

TimeConvert - convert UTC to/from local time and/or reformat the string representation

AMF - accept multiple files from Windows Explorer context menu

DateDuration -  literal description of the difference between given dates

Apps:

Touch - set the "modified" timestamp of a file to current time

Show For Files - tray menu to show/hide files extensions, hidden & system files, and selection checkboxes

SPDiff - Single-Pane Text Diff

 

Link to comment
Share on other sites

Quote

you get a return value of empty string and @error value of 0?

Yes.

Quote

 

your share appears on the "Shares" list with its name set to the name you specified ("shared")?

 

Yes.

I use Windows 10 x64.

Edited by behdadsoft
Link to comment
Share on other sites

1) what if you set a specific available drive letter (e.g. "Z:" instead of "*")? same return and @error values?

2) shot in the dark: disable your anti-virus and recheck.

 

Signature - my forum contributions:

Spoiler

UDF:

LFN - support for long file names (over 260 characters)

InputImpose - impose valid characters in an input control

TimeConvert - convert UTC to/from local time and/or reformat the string representation

AMF - accept multiple files from Windows Explorer context menu

DateDuration -  literal description of the difference between given dates

Apps:

Touch - set the "modified" timestamp of a file to current time

Show For Files - tray menu to show/hide files extensions, hidden & system files, and selection checkboxes

SPDiff - Single-Pane Text Diff

 

Link to comment
Share on other sites

Quote

1) what if you set a specific available drive letter (e.g. "Z:" instead of "*")? same return and @error values?

Return 0 and 0. but when i run it again, error code is 3 and return 0. while there is no Map Drives.

Quote

2) shot in the dark: disable your anti-virus and recheck.

I do that, but nothing changed.

Link to comment
Share on other sites

1 minute ago, behdadsoft said:

made Different Map drives

what does that mean?

Signature - my forum contributions:

Spoiler

UDF:

LFN - support for long file names (over 260 characters)

InputImpose - impose valid characters in an input control

TimeConvert - convert UTC to/from local time and/or reformat the string representation

AMF - accept multiple files from Windows Explorer context menu

DateDuration -  literal description of the difference between given dates

Apps:

Touch - set the "modified" timestamp of a file to current time

Show For Files - tray menu to show/hide files extensions, hidden & system files, and selection checkboxes

SPDiff - Single-Pane Text Diff

 

Link to comment
Share on other sites

and P: does not appear in "My Computer"? what about cmd "dir P:"?

Signature - my forum contributions:

Spoiler

UDF:

LFN - support for long file names (over 260 characters)

InputImpose - impose valid characters in an input control

TimeConvert - convert UTC to/from local time and/or reformat the string representation

AMF - accept multiple files from Windows Explorer context menu

DateDuration -  literal description of the difference between given dates

Apps:

Touch - set the "modified" timestamp of a file to current time

Show For Files - tray menu to show/hide files extensions, hidden & system files, and selection checkboxes

SPDiff - Single-Pane Text Diff

 

Link to comment
Share on other sites

@error 0 means OK, no error.

Signature - my forum contributions:

Spoiler

UDF:

LFN - support for long file names (over 260 characters)

InputImpose - impose valid characters in an input control

TimeConvert - convert UTC to/from local time and/or reformat the string representation

AMF - accept multiple files from Windows Explorer context menu

DateDuration -  literal description of the difference between given dates

Apps:

Touch - set the "modified" timestamp of a file to current time

Show For Files - tray menu to show/hide files extensions, hidden & system files, and selection checkboxes

SPDiff - Single-Pane Text Diff

 

Link to comment
Share on other sites

I found what is the problem.

problem is relate to this part of my code:

#RequireAdmin

when i removed it, my code work very well.

Quote

 

@error 0 means OK, no error.

 

According to Help:

002.png

 

thank you for your helps.

+1:)

Edited by behdadsoft
Link to comment
Share on other sites

  • Developers

Please do not report posts when you think there is a bug. 
So for starters: You never mentioned you where running this script in Admin mode, which is quite essential to mention when reporting issues.
Are you getting a UAC prompt and if so are you using the same account?
Please explain why you think there is a bug in AutoIt in stead of your script and exactly describe what you are doing!

Jos 

Edited by Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

Several reasons a drive won't get mapped.  If your current user is a local account, you'll need to pass in credentials to map to a remote computer.  If you are using a network account, but running elevated, you will also need to pass in credentials.  If you are using a network account, and not running elevated, windows automagically use your login credentials to map a drive.  So if you have the permissions on the server you are mapping you will automatically succeed in the mapping.

Other reasons a drive will failed to get mapped is if there is already another mapped drive to that server.  There are workarounds for this, you can instead map by the IP.

 

I'd suggest you attempt to pass in credentials to the function, with a user that has the rights on the target machine.

Edited by jdelaney
IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window.
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...