Jump to content

Recommended Posts

Posted

Hello guys.

 

I have a small issue that i am facing that really bugs me. It seems to be a small issue but i am not able to find the solution. Maybe Forum Members eyes are better and you guys can spot the error.

 

So . I have written a script where I open Windows Explorer and navigate to a specific IP address (of a server). Up until this point it works fine. 

But once the IP is accessed, the "windows security" dialog box opens up asking me to enter the username and password (which is normal)

Although the windows is active, I am not able to send the username and password to the dialogbox and autoit refuses to react. Once i close the window by clicking cancel or ok, then autoit contiues with the script and enters the username and password in the script page. 

This is really bugging me. Here is a sample of my code. If anyone can help me with this regards would be awesome.

 

 

Global $Path = '\\'&'IP Address'&'\c$'
Global $username = "username"

Global $password = "password"

ShellExecute($Path)
send($username )

Send(Enter)

Send ($password)

 

 

This is just a sample code. 

Autoit navigates to the correct ip address. else it would not ask me for the username and password.

I tried also getting the title of the window which is also not possible. !!!!!!!!!

Please.. I need help here :)

  • Developers
Posted (edited)

Why not make it easier and do an DriveMapAdd() command in the script to make de share available? This also avoids the explorer window popping up with its security prompt.

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.
  :)

Posted

I tried it like this. But this doesnt work either. There is no mapped network too !!!!!!!

AHH:: i am going nuts with this issue

 

Local $ping = Ping("IP address", 150)
If $ping Then
    if DriveStatus("Y:\") = "INVALID" Then

       DriveMapAdd("Y:", "\\IP address\c$" , "" , "[administrator]" , "[password]" )

    EndIf

 Else

    if DriveStatus("Y:\") = "UNKNOWN" Then

       DriveMapDel("Y:")

    EndIf

EndIf
 

Posted

yep.. got it to work.. just had to concatnate the IP address when i enter it. 

But strange is, if the drive already exists, then the mapping doesnt work and the code exits automatically. It is needed to delete the drive first and then map a new ip to that drive.. strange. Because there ll be some other people who will also be using my code. and if they have something important in say "Y" drive which i would delete, then it could be a problem 

any workaround for this from anyone  ?

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...