Jump to content

Recommended Posts

Posted

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
Posted

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")
Posted

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.

Posted

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.

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
  • Recently Browsing   0 members

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