Modify

Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#630 closed Bug (No Bug)

DriveMapAdd doesn't work on Vista With Use of #RequireAdmin.

Reported by: Tlem Owned by:
Milestone: Component: AutoIt
Version: 3.2.12.0 Severity: None
Keywords: Cc:

Description

Sorry for the ticket 614 (http://www.autoitscript.com/trac/autoit/ticket/614) I doesn't give all the precisions of my testings (I apologize).

This is the script :

;#RequireAdmin
If DriveMapAdd("Y:", "\\myserver\stuff") Then
	MsgBox(0, "Info", "Drive mounted.")
	If DriveMapDel("Y:") Then MsgBox(0, "Info", "The drive is Unmounted")
Else
	MsgBox(16, "Info", "The drive was not mounted")
EndIf

If you launch the script with admin right or if you add #RequireAdmin on the top of the script, it said that all is okay but in explorer no drive is mapped ???

Is it something normal, or I make a mistake?

Attachments (0)

Change History (2)

comment:1 Changed 11 years ago by Valik

  • Resolution set to No Bug
  • Status changed from new to closed

You mounted the drive with elevated rights which means programs without elevated rights can't see it. Your normal Explorer window running non-elevated can not see it. You must start a new instance of Explorer with elevated rights to see it. But there's another catch. With my system, I have to close out all existing Explorer windows to open an elevated instance of Explorer. Even though I'm manually requesting an elevated version, it seems to just defer to the non-elevated explorer.exe process. You must have all Explorer windows closed so that when you try to open an (elevated) Explorer window it spawns a new process that stays (and gets elevated). Once you have a properly elevated Explorer window you can see the drive. Without closing all the other windows first it just passes the request along to the currently running non-elevated instance of Explorer which isn't what you want to see.

An easier alternative to confirm the drive is mounted is to run an elevated script to mount the drive like normal. Now start an elevated command interpreter (cmd.exe) and you'll see that the mounted drive is there and accessible. A non-elevated command interpreter cannot see the drive.

This is not a bug - at least not in AutoIt. I can use an elevated Explorer to mount the drive using the built-in interface and that drive will not be visible to non-elevated programs.

comment:2 Changed 11 years ago by Tlem

Thank you very much for your explications.
I appreciate this attention. ;)

Guidelines for posting comments:

  • You cannot re-open a ticket but you may still leave a comment if you have additional information to add.
  • In-depth discussions should take place on the forum.

For more information see the full version of the ticket guidelines here.

Add Comment

Modify Ticket

Action
as closed The ticket will remain with no owner.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.