CrewXp Posted October 4, 2005 Share Posted October 4, 2005 (edited) When my computer starts, it automatically is connected to a network drive with a certain usergroup. "Everyone". I can't use this usergroup anymore because then everyone can get on. And I can't set the computer to not automatically map it because it has a program that returns all my settings back to the original state.Anyways,I created an extensive script that logs me in after entering a username/password.After I login, it's supposed to map the drive using a different usergroup. After running the script, I see that no drives have been mapped. When I try to map it manually, I get this message:"The network folder specified is curently mapped using a different user name and password.To connect using a different user name and password, first disconnect any existing mappings to this network share.""Then after I click ok, I get:""Multiple connects to a server or shared resource by the same user, using more than one user name, are not allowed. Disconnect all previous connections to the server or shared resource and try again.""What am I doing wrong? The drive mappings have been disconnected. The script does it like 3 times and I've done it manually too.Here's SOME of my program code:Func login();Assign Null variablesGLOBAL $temppass = 0GLOBAL $typepass = 1GLOBAL $filepass = 2GLOBAL $error = 0Sleep(700)MsgBox(0, "Program Loading... ", "After you press OK, please wait for the login box to come up. DO NOT press F2 Again!")Sleep(700)$linesinfile = _FileCountLines("\\b86902\Settings$\userlist.ini")Sleep(1000)$typeuser = InputBox("username?", "Enter your Username");user types nameFor $j = 1 to $linesinfile;this'll happen over every line in the file$fileuser = FileReadLine("\\b86902\Settings$\userlist.ini", $j);it reads the user databaseIf $fileuser <> $typeuser Then;if the name typed by the user isn't the line just read from the fileDo$j = $j + 2;add 2 to the line count since the password is on every other line as is the username$fileuser = FileReadLine("\\b86902\Settings$\userlist.ini", $j);reads from the file on the line equal to $jUntil $fileuser = $typeuser OR $j > $linesinfile;until the username is found or you reach the end of the fileEndIfIf $fileuser = $typeuser Then;if the username is right-i hope it is after all that$j = $j + 1;adds a number to $j, which remember still is the line number where the username typed in is found$typepass = InputBox("password?", "enter password for " & $fileuser, "", "*");the user types his/her password in, each character is replaced with a *$filepass = FileReadLine("\\b86902\Settings$\userlist.ini", $j);reads the password from the fileIf $typepass = 3 Then;if the idiot user entered a wrong passwdGLOBAL $error = 1;displays an error, heres where you'd put an alert to the computer ownerEndIfIf $filepass <> $typepass Then;if the idiot user entered a wrong passwdmsgbox(0, "error", "Password incorrect!!!")GLOBAL $error = 1;displays an error, heres where you'd put an alert to the computer ownerEndIfIf $typeuser = "" Then;if the idiot user entered a wrong passwdGLOBAL $error = 1;displays an error, heres where you'd put an alert to the computer ownerEndIfIf $typepass = "" Then;if the idiot user entered a wrong passwdGLOBAL $error = 1;displays an error, heres where you'd put an alert to the computer ownerEndIfIf $error = 0 ThenIf $filepass = $typepass Then;if the password is corectGLOBAL $user = IniRead("\\b86902\Settings$\names.ini", $typeuser, "Name", "NotFound")MsgBox(0, "Welcome " & $typeuser, $user &" is now logged in")IniWrite("\\b86902\Settings$\sessions.ini", @ComputerName, "Name", $user);TESTING PURPOSES BELOW;SplashTextOn($user, "", 50, -10, 300, 0, 100, "", 10)ToolTip("Logged in as: " & $user, 450, 0)DriveMapAdd("R:", "\\b86902\Yearbook" , 0, "b86902\yearbook", "yearbookpassDriveMapAdd("U:", "\\b86902\PHOTOS" , 0, "b86902\yearbook", "yearbookpass")EndIfElsereturnEndIf;a wellcome msg, here put the script to login to the shared drive;ExitEndIfNext;End FunctionEndFunc ;==>_Exit Edited October 4, 2005 by CrewXp Link to comment Share on other sites More sharing options...
AutoChris Posted October 4, 2005 Share Posted October 4, 2005 DriveMapAdd("R:", "\\b86902\Yearbook" , 0, "b86902\yearbook", "yearbookpass DriveMapAdd("U:", "\\b86902\PHOTOS" , 0, "b86902\yearbook", "yearbookpass") In your code, I noticed the end of the first DriveMapAdd is missing the end quote and end parenthesis. However, if that were a part of your working (sort of) script, you would have received an AutoIt error rather than mapping issues. Could you put in a DriveMapDel() before the DriveMapAdd() to make sure they are deleted before you add the mapped drives? Link to comment Share on other sites More sharing options...
CrewXp Posted October 5, 2005 Author Share Posted October 5, 2005 yea, I accidently cut it off when I copied it on the forums. That's fine. Even if that was it, it still shoulda mapped the "u:", but it doesn't. And yea, I have DriveMapDel()'s at the beginning of the script. It looks like it works. The previous mapping disappears when I open My Computer. But I get that message Link to comment Share on other sites More sharing options...
jefhal Posted October 5, 2005 Share Posted October 5, 2005 it has a program that returns all my settings back to the original stateDo you mean the computer is in a security group that applies policies to it? Are you the admin? If so, you might want to look at your policies (possibly overlapping ones). If not, you may not be able to disconnect a mapped drive that was mapped by another account. You may only have read/list on that mapped drive? ...by the way, it's pronounced: "JIF"... Bob Berry --- inventor of the GIF format Link to comment Share on other sites More sharing options...
Danny35d Posted October 5, 2005 Share Posted October 5, 2005 (edited) I believe that your problem is this line at the begining of the script:_FileCountLines("\\b86902\Settings$\userlist.ini")When you used this "\\b86902\Settings$\userlist.ini" windows make a network connecting without a drive letter using the logon user for credentials. When your script ask for user name and password to connect if the user name and password are different as the logon user by Windows Security you cannot connect to the same server or computer with two different credentials.If you want to try open command prompt and type this:net use R: \\b86902\Settings$and then after succeful map to R: try mapping to U: using different credentialsnet use U: \\b86902\PHOTOS user:Domain\Username passwordyou will have the same message because you are trying to connect to the same server or computer with two different credentials......I haven't test it but may this fix your problem, right before these lines:DriveMapAdd("R:", "\\b86902\Yearbook" , 0, "b86902\yearbook", "yearbookpassDriveMapAdd("U:", "\\b86902\PHOTOS" , 0, "b86902\yearbook", "yearbookpass")add this line:DriveMapDel("\\b86902\settings$") Edited October 5, 2005 by Danny35d AutoIt Scripts:NetPrinter - Network Printer UtilityRobocopyGUI - GUI interface for M$ robocopy command line Link to comment Share on other sites More sharing options...
CrewXp Posted October 5, 2005 Author Share Posted October 5, 2005 that seems logical. Do you know how I would be able to fix this? How would I be able to access users.ini like this? Is there a way to read the ini through a username and password? Thx Link to comment Share on other sites More sharing options...
jefhal Posted October 5, 2005 Share Posted October 5, 2005 Is there a way to read the ini through a username and password? ThxCheck the manual for: FileReadLine ( filehandle or "filename" [, line] ) ...by the way, it's pronounced: "JIF"... Bob Berry --- inventor of the GIF format Link to comment Share on other sites More sharing options...
Danny35d Posted October 5, 2005 Share Posted October 5, 2005 (edited) that seems logical. Do you know how I would be able to fix this? How would I be able to access users.ini like this? Is there a way to read the ini through a username and password? ThxThe are only two way that may fix your script is:1) Ask for user name and password at the begging of the script and right after that map to R: and U: so the _FileCount(.....) and _FileRead(.....) will used the same credential that were used to map R: and U:.OR2) Right before these lines: DriveMapAdd("R:", "\\b86902\Yearbook" , 0, "b86902\yearbook", "yearbookpass DriveMapAdd("U:", "\\b86902\PHOTOS" , 0, "b86902\yearbook", "yearbookpass") add this line: DriveMapDel("\\b86902\settings$") this will delete the path connected with the logon user credentials right before you map to R: and U:NOTE: if DriveMapDel don't work try using Run or Runwait with net use \\b86902\settings$ /d Edited October 5, 2005 by Danny35d AutoIt Scripts:NetPrinter - Network Printer UtilityRobocopyGUI - GUI interface for M$ robocopy command line Link to comment Share on other sites More sharing options...
CrewXp Posted October 5, 2005 Author Share Posted October 5, 2005 (edited) ok, I'm going to try your method 2 tomorrow when school starts up again. I'll post back here when I do. But if Anyone Else here see's something wrong or can suggest something, please go ahead. Tomorrow will be my last day to get this ready before the students start coming in and using it. Thanks! I'll check back here tomorrow morning. Thx again (I also posted another topic regarding screen lock, another security feature) Edited October 5, 2005 by CrewXp Link to comment Share on other sites More sharing options...
CrewXp Posted October 5, 2005 Author Share Posted October 5, 2005 tried it, didn't work. Still doesn't map.... Link to comment Share on other sites More sharing options...
CrewXp Posted October 5, 2005 Author Share Posted October 5, 2005 still doesn't work. Here's my function code:Func login();Assign Null variablesIf $loggedin = 1 Thenmsgbox(0, "YbManager", "You are already logged in! Press F10 to logout first, then re-run program!")ElseGLOBAL $temppass = 0GLOBAL $typepass = 1GLOBAL $filepass = 2GLOBAL $error = 0Sleep(700)MsgBox(0, "Program Loading... ", "After you press OK, please wait for the login box to come up. DO NOT press F2 Again!")Sleep(700)$linesinfile = _FileCountLines("\\b86902\Settings$\userlist.ini")Sleep(1000)$typeuser = InputBox("username?", "Enter your Username");user types nameFor $j = 1 to $linesinfile;this'll happen over every line in the file$fileuser = FileReadLine("\\b86902\Settings$\userlist.ini", $j);it reads the user databaseIf $fileuser <> $typeuser Then;if the name typed by the user isn't the line just read from the fileDo$j = $j + 2;add 2 to the line count since the password is on every other line as is the username$fileuser = FileReadLine("\\b86902\Settings$\userlist.ini", $j);reads from the file on the line equal to $jUntil $fileuser = $typeuser OR $j > $linesinfile;until the username is found or you reach the end of the fileEndIfIf $fileuser = $typeuser Then;if the username is right-i hope it is after all that$j = $j + 1;adds a number to $j, which remember still is the line number where the username typed in is found$typepass = InputBox("password?", "enter password for " & $fileuser, "", "*");the user types his/her password in, each character is replaced with a *$filepass = FileReadLine("\\b86902\Settings$\userlist.ini", $j);reads the password from the fileIf $typepass = 3 Then;if the idiot user entered a wrong passwdGLOBAL $error = 1;displays an error, heres where you'd put an alert to the computer ownerEndIfIf $filepass <> $typepass Then;if the idiot user entered a wrong passwdmsgbox(0, "error", "Password incorrect!!!")GLOBAL $error = 1;displays an error, heres where you'd put an alert to the computer ownerEndIfIf $typeuser = "" Then;if the idiot user entered a wrong passwdGLOBAL $error = 1;displays an error, heres where you'd put an alert to the computer ownerEndIfIf $typepass = "" Then;if the idiot user entered a wrong passwdGLOBAL $error = 1;displays an error, heres where you'd put an alert to the computer ownerEndIfIf $error = 0 ThenIf $filepass = $typepass Then;if the password is corectGLOBAL $user = IniRead("\\b86902\Settings$\names.ini", $typeuser, "Name", "NotFound")MsgBox(0, "Welcome " & $typeuser, $user &" is now logged in")IniWrite("\\b86902\Settings$\sessions.ini", @ComputerName, "Name", $user);TESTING PURPOSES BELOW;SplashTextOn($user, "", 50, -10, 300, 0, 100, "", 10)ToolTip("Logged in as: " & $user, 450, 0)DriveMapDel("O:")DriveMapDel("R:")DriveMapDel("U:")DriveMapDel("\\b86902\settings$")DriveMapDel("\\b86902\Settings$")DriveMapDel("\\b86902\settings$\")DriveMapDel("\\b86902\Settings$\")DriveMapDel("\\b86902\")DriveMapDel("\\b86902\Yearbook")DriveMapDel("\\b86902\photos")DriveMapDel("\\b86902")DriveMapDel("\\b86902\Programs\")DriveMapDel("\\b86902\Programs")DriveMapDel("\\b86902")DriveMapDel("\\b86902\*")DriveMapDel("\\b86902\Programs\YbManager.exe")DriveMapDel("\\b86902\Settings$\userlist.ini")DriveMapDel("\\b86902\Settings$\time.ini")DriveMapDel("\\b86902\Programs")runwait(@comspec & ' /c ' & "ipconfig /release","",@SW_HIDE)runwait(@comspec & ' /c ' & "ipconfig /renew","",@SW_HIDE)Sleep(1000)DriveMapAdd("R:", "\\b86902\Yearbook" , 0, "b86902\yearbook", "yearbooksecure")DriveMapAdd("U:", "\\b86902\PHOTOS" , 0, "b86902\yearbook", "yearbooksecure");TIMESTAMP$day = _DateDayOfWeek( @WDAY )$time = @HOUR & ":" & @MIN & ":" & @SEC & "::" & @mon & "." & @mday & "." & @year;$date = @mon & "." & @mday & "." & @year;$myfile = FileOpen("C:\blah.txt",1);FileWriteLine($myfile,$value)$loggedin = 1Sleep(2000)IniWrite ( "\\b86902\Settings$\time.ini", $typeuser, $day & "/Login", $time )gui()EndIfElsereturnEndIf;a wellcome msg, here put the script to login to the shared drive;ExitEndIfNext;End FunctionEndIfEndFunc ;==>_Exit Link to comment Share on other sites More sharing options...
CrewXp Posted October 5, 2005 Author Share Posted October 5, 2005 also, I've tried this to test it, IT DIDN'T WORK. So I don't think that's the problem. This doesn't call for any network connections. Before it maps it.DriveMapDel("O:")DriveMapDel("R:")DriveMapDel("U:")DriveMapDel("\\b86902\settings$")DriveMapDel("\\b86902\Settings$")DriveMapDel("\\b86902\settings$\")DriveMapDel("\\b86902\Settings$\")DriveMapDel("\\b86902\")DriveMapDel("\\b86902\Yearbook")DriveMapDel("\\b86902\photos")DriveMapDel("\\b86902")DriveMapDel("\\b86902\Programs\")DriveMapDel("\\b86902\Programs")DriveMapDel("\\b86902")DriveMapDel("\\b86902\*")DriveMapDel("\\b86902\Programs\YbManager.exe")DriveMapDel("\\b86902\Settings$\userlist.ini")DriveMapDel("\\b86902\Settings$\time.ini")DriveMapDel("\\b86902\Programs")runwait(@comspec & ' /c ' & "ipconfig /release","",@SW_HIDE)runwait(@comspec & ' /c ' & "ipconfig /renew","",@SW_HIDE)Sleep(1000)DriveMapAdd("R:", "\\b86902\Yearbook" , 0, "b86902\yearbook", "yearbooksecure")DriveMapAdd("U:", "\\b86902\PHOTOS" , 0, "b86902\yearbook", "yearbooksecure")MsgBox(4096,"", "Drives mapped!") Link to comment Share on other sites More sharing options...
jefhal Posted October 5, 2005 Share Posted October 5, 2005 also, I've tried this to test it, IT DIDN'T WORK. So I don't think that's the problem. This doesn't call for any network connections. Before it maps it.Are you the admin? If not, you are probably banging your head against a security policy. ...by the way, it's pronounced: "JIF"... Bob Berry --- inventor of the GIF format Link to comment Share on other sites More sharing options...
CrewXp Posted October 5, 2005 Author Share Posted October 5, 2005 I don't really see what that has to do with this. Yes, I'm an admin. When I log on to the computer using workstation logged in as administrator or admin, I still get the same problem. And also, it seems my script only works on my computer (and I connect to the network the same as everyone else). But some times I have found, it didn't map on mine. But it's never worked on anyone elses. Link to comment Share on other sites More sharing options...
CrewXp Posted October 5, 2005 Author Share Posted October 5, 2005 (edited) I found something out. When I put the program individually on each computer's W: (a drive that u can put things on without DeepFreeze taking it off), and restart the computer. Then try to login again, it works. But this will not allow me to update the program easily. I will have to manually put it on each computer again. Before, I put a shortcut on each computer that ran "\\b86902\Programs\YbManager.exe" or "\\b86902\yearbook\YbManager.exe" (Can't remember which one, both have the file) Is there any way to fix my problem now that I have found the problem? Edited October 5, 2005 by CrewXp Link to comment Share on other sites More sharing options...
Danny35d Posted October 5, 2005 Share Posted October 5, 2005 I really don't know much about Deep Freeze.... What it is W:? a network share or hard disk partition Also you can try to keep your script on a network share and create a shortcut of the script on W: This way the only file to update is the one on the share.... Hope this will help you AutoIt Scripts:NetPrinter - Network Printer UtilityRobocopyGUI - GUI interface for M$ robocopy command line Link to comment Share on other sites More sharing options...
jefhal Posted October 5, 2005 Share Posted October 5, 2005 Is there any way to fix my problem now that I have found the problem?1. Uninstall Deepfreeze2. Tell us everything about your problem before asking for input ...by the way, it's pronounced: "JIF"... Bob Berry --- inventor of the GIF format Link to comment Share on other sites More sharing options...
CrewXp Posted October 6, 2005 Author Share Posted October 6, 2005 My W: is a physical drive. It's just a partition. Is there any way to have a shortcut point to like //b86902/programs/YbManager.exe so it will work? Again, To get it to work, I have to manually copy it to my computer, I can't run it off the network. Maybe, is there a way to create a loader, that downloads the YbManager file to your computer, then exit. Then start up YbManager on the computer? Thanks! Link to comment Share on other sites More sharing options...
jefhal Posted October 6, 2005 Share Posted October 6, 2005 From the DeepFreeze website:Deep Freeze makes computing environments easier to manage and maintain. Each restart eradicates all changes and resets the computer to its original state, right down to the last byte.Why do you keep asking? Is it because we keep answering? ...by the way, it's pronounced: "JIF"... Bob Berry --- inventor of the GIF format Link to comment Share on other sites More sharing options...
Danny35d Posted October 6, 2005 Share Posted October 6, 2005 For that create a small batch file on W: something like: @echo off copy "\\b86902\Programs\YbManager.exe" W: net use "\\b86902\Programs" /d call W:\YbManager.exe AutoIt Scripts:NetPrinter - Network Printer UtilityRobocopyGUI - GUI interface for M$ robocopy command line 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