Cem Posted January 10, 2005 Share Posted January 10, 2005 How and with what Editor I make these lines save it as au3After it converting is easy.net use Z: /deletenet use Z: \\10.10.10.10\Dir Password /user:meecho You are Logged On The Drive !pauseI dont want the user to see the password or the userename.Is there a way to look who is using it by checking the Domain-User-Name.Regards Link to comment Share on other sites More sharing options...
SvenP Posted January 10, 2005 Share Posted January 10, 2005 How and with what Editor I make these lines save it as au3After it converting is easy.I dont want the user to see the password or the userename.Is there a way to look who is using it by checking the Domain-User-Name.Regards<{POST_SNAPBACK}>Hello Cem,Some useful AutoIt functions for this one are DriveMapAdd, DriveMapDel and DriveMapGet.An example code:$Username="me" $Password="Password" DriveMapGet("Z:") if not @error then DriveMapDel("Z:") DriveMapAdd("Z:","\\10.10.10.10\Dir",0, $Username, $Password)Or even better is to use: DriveMapAdd("Z:","\\10.10.10.10\Dir",8, $Username) for the last line.That shows the user an authentication dialog if authentication is required.To get the currently logged on user name, you could use:$Username=@UserName on the first line of the script.Regards,-Sven Link to comment Share on other sites More sharing options...
Cem Posted January 10, 2005 Author Share Posted January 10, 2005 Thank You SvenP !!! it worked !!!!!!!!!!!! Is there a list of the Script Commands somewhere ? /Cem Link to comment Share on other sites More sharing options...
SvenP Posted January 10, 2005 Share Posted January 10, 2005 Thank You SvenP !!! it worked !!!!!!!!!!!!Is there a list of the Script Commands somewhere ?/Cem<{POST_SNAPBACK}>Well, if you installed AutoIt3 correctly, you should have an "AutoIt help file" in your Start menu/Programs/AutoIt3.Regards,-Sven Link to comment Share on other sites More sharing options...
Cem Posted January 10, 2005 Author Share Posted January 10, 2005 Thank You again SvenPI now made a "not working" script for couple of usersgetting this error message:Line 0 (File "C:\usertest.exe"):Until $i = 11Error: "Until" satement with no matching "Do" statement.Well I dont get it, to me I have a "Do"$validuser=@UserName$soy(0)="user0"$soy(1)="user1"$soy(2)="user2"$soy(3)="user3"$soy(4)="user4"$soy(5)="user5"$soy(6)="user6"$soy(7)="user7"$soy(8)="user8"$soy(9)="user9"$soy(10)="user10"$soy(11)="user11"$i = 0Doif $validuser=$soy($i) Then$Username="user11"$Password="Password"DriveMapGet("Z:")if not @error then DriveMapDel("Z:")DriveMapAdd("Z:","\\10.10.10.10\DIR",0, $Username, $Password)EXITelse $i = $i + 1Until $i = 11MsgBox(0, "Example", "Invalid User !") Link to comment Share on other sites More sharing options...
nobby Posted January 10, 2005 Share Posted January 10, 2005 The problem may be that there are no endif. Check the help file as all the answer to your problem are clearly documented. CheersNobby Link to comment Share on other sites More sharing options...
Cem Posted January 10, 2005 Author Share Posted January 10, 2005 Thanks thats what is was tilthis point I agree in reading. How can I search for filling an area with values. As I try it does not work $soy[0] = "user0" does get me an error Expected a "=" operator in assignment statement. Please advice (please) Link to comment Share on other sites More sharing options...
SlimShady Posted January 10, 2005 Share Posted January 10, 2005 (edited) If you want information about arrays, here's a topic:http://www.autoitscript.com/forum/index.php?showtopic=7319There was another one. It was really well-explained but I can't find it.I'll search some more.Edit:Here:http://www.autoitscript.com/forum/index.php?showtopic=6998 Edited January 10, 2005 by SlimShady Link to comment Share on other sites More sharing options...
Cem Posted January 10, 2005 Author Share Posted January 10, 2005 Thank You SlimShady !As far as I came is this and itlooks like I have not done anything wrong(reading on the Link You gave me)AutoIt Error$soy[0] = "user0"$soy^ ERRORError: Expected a "=" operator in assignment statement.Dim $soy = 11$soy[0]= "user0"$soy[1] = "user1"$soy[2] = "user2"$soy[3] = "user3"$soy[4] = "user4"$soy[5] = "user5"$soy[6] = "user6"$soy[7] = "user7"$soy[8] = "user8"$soy[9] = "user9"$soy[10] = "user10"$soy[11] = "user11"$validuser=@UserName$Username="Me"$Password="Password"$i = 0Doif $validuser=$soy[$i] ThenDriveMapGet("Z:")if not @error then DriveMapDel("Z:")DriveMapAdd("Z:","\\10.10.10.10\DIR",0, $Username, $Password)endif $i = $i + 1Until $1 = 11exitMsgBox(0, "Invalid User") Link to comment Share on other sites More sharing options...
SlimShady Posted January 10, 2005 Share Posted January 10, 2005 I'm sorry, but it is wrong. Here's an example I posted in the other topic. ;WITH an array (version 1) Dim $var[4] $var[0] = "value0" $var[1] = "value1" $var[2] = "value2" $var[3] = "value3" Link to comment Share on other sites More sharing options...
Cem Posted January 10, 2005 Author Share Posted January 10, 2005 IT's DONE !!!!This is a working Version now:Dim $soy[12]$soy[0] = "user0"$soy[1] = "user1"$soy[2] = "user2"$soy[3] = "user3"$soy[4] = "user4"$soy[5] = "user5"$soy[6] = "user6"$soy[7] = "user7"$soy[8] = "user8"$soy[9] = "user9"$soy[10] = "user10"$soy[11] = "user11"$validuser=@UserName$i = 0Doif $validuser = $soy[$i] ThenMsgBox(0, "You are going to be loggede in because the Value of $i is:", $i)$Username="me"$Password="password"DriveMapGet("Z:")if not @error then DriveMapDel("Z:")DriveMapAdd("Z:","\\10.10.10.10\DIR",0, $Username, $Password)endifMsgBox(0, "No login because the Value of $i is:", $i) $i = $i + 1Until $i >= 12exitMsgBox(0, "Invalid User")THANKS FOR ALL YOUR SO FAST H E L P Link to comment Share on other sites More sharing options...
IanR Posted January 11, 2005 Share Posted January 11, 2005 A few tips I thought might help: The way Windows Networking operates, once a username/password has been supplied for a particular server or domain, it need not be supplied again in subsequent NET USE commands. Thus, if you connect to one share (netlogon seems sensible) from within an autoit script (which hides the password) your others can be in a standard batch-file which is Run from the script. This is easier to maintain than modifying the script for each change of drive-mapping. So, doing it this way you just need a simple script that takes-in a password (and optionally a username if different from the local one) makes a single connection to the server, checks the error-flag to see it's successful, then launches the batch-file. BTW, On NT/2k/XP-based systems, shares are permanent by default, and this can lead to a serious security problem if not dealt-with. (Trust Micrsosoft ) Therefore it's highly advisable to start the whole process with the commands: NET USE * /DELETE /YES and NET USE /PERSISTENT:NO either called by RunWait statements, or by equivalent Autoit DriveMap commands. Hope this helps, Ian. If it says "Made in China" then it just might be made by slave labour... Link to comment Share on other sites More sharing options...
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