Naveen_Naveen Posted June 1, 2017 Posted June 1, 2017 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 Jos Posted June 1, 2017 Developers Posted June 1, 2017 (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 June 1, 2017 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.
Naveen_Naveen Posted June 1, 2017 Author Posted June 1, 2017 (edited) can you please give an example of how you would go about doing this ? Edited June 1, 2017 by Naveen_Naveen
Naveen_Naveen Posted June 1, 2017 Author Posted June 1, 2017 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
Naveen_Naveen Posted June 1, 2017 Author Posted June 1, 2017 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 ?
Moderators JLogan3o13 Posted June 1, 2017 Moderators Posted June 1, 2017 (edited) Per the help file, if you specify '*' in the first parameter it will map an unused drive letter. Edited June 1, 2017 by JLogan3o13 "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum!
Developers Jos Posted June 1, 2017 Developers Posted June 1, 2017 Good to see you were able to progress this to a working solution by just thinking out load in this forum while trying. 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.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now