Jump to content
Sign in to follow this  
shivamfet

Mapped Drive not visible in the explorer

Recommended Posts

shivamfet

I have written the following auto script to map a network drive, the value return is 1, but the mapped drive is not visible in the explorer, The OS is Win 7 enterprise service pack 1. Following is the way i am trying to map.

 

Local $isMapDriveSuccessful = DriveMapAdd($driveName , $hostname & ":" & $portNumber, 0 , "username" , "password")
if ($isMapDriveSuccessful == 0) Then
Exit
 
 
where $hostname is passed as parameter "http://localhost" and portNumber as 60751 .
 
Hostname and portname are correct and when i map manually the drive from explorer i can see the mapped drive.
 
Can you please help me out ?
 
Thanks
Shivam

Share this post


Link to post
Share on other sites
ViciousXUSMC

I had the same issue using the native AutoIt map drive feature.

I ended up using @CommSpec with the Net Use command to map the drive instead, this is the normal way I would do it anyways.

Example:

RunWait(@ComSpec & " /c Net Use X: \\vtrendserver\ofcscan /persistent:no")

Share this post


Link to post
Share on other sites
tlman12

are you using a #RequireAdmin or running the script as admin?

if so you are mapping the drive under admin context and it would only be accessible by another process running in admin context. as a test you can try running the command prompt as administrator and see if you can see the mapping, or running a DriveMapGet($driveName) within admin context.

Share this post


Link to post
Share on other sites
spudw2k

are you using a #RequireAdmin or running the script as admin?

if so you are mapping the drive under admin context and it would only be accessible by another process running in admin context. as a test you can try running the command prompt as administrator and see if you can see the mapping, or running a DriveMapGet($driveName) within admin context.

Was going to suggest the same thing.

Share this post


Link to post
Share on other sites
ViciousXUSMC

To test that can you close explorer shell and re-launch it from an admin cmd prompt? 

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  

×