ChrisL Posted February 27, 2006 Posted February 27, 2006 (edited) Try this and see how far you get. I have commented out your save part (it writes to the ini file as a machine is selected) and dupe folders for now, remove your tmp file that you already have and let it create a new one. Add a machine and set a password for it (by the way this only seems to work the first time I haven't figured that bit out) Then open up the tmp file and have a look at the format. expandcollapse popup#include <GUIConstants.au3> #include <GuiList.au3> #include <GuiListView.au3> #include <Process.au3> #include<Array.au3> #include<File.au3> ;#NoTrayIcon dim $folders, $Countlines, $InArray, $aret $v = "2.00" $txtsize = FileGetSize("~netfldr.tmp") if $txtsize = 0 then FileDelete ( "~netfldr.tmp" ) endif If FileExists("~netfldr.tmp") Then $Folders = IniReadSectionNames("~netfldr.tmp") $CountLines = inireadsectionnames ("~netfldr.tmp") if $CountLines[0] > 60 Then msgbox (262160,"Backup", "Your Backup configuration specifies more than 60 network shares. This is beyond the limit of 60 network shares that Backup is capable of. Please uninstall Backup, delete the CONFIG.QIT file containing your settings and then re-install Backup.") Else msgbox (262208,"Backup", "Backup is currently set to protect " & $countlines[0] & " network shares on other machines.") EndIf EndIf ;$CountLines = _FileCountLines("~netfldr.tmp") $Main = GUICreate("Backup" & " version " & $v & " Setup and Installation Wizard",640,480) TrayTip("Backup Step 2/7", "Step 2: This step is completely optional. If you have folders shared on other computers you can add them to the backup as well. Laptops, hand held devices, Apple and IBM compatible desktop computers.", 5, 1) $filemenu = GuiCtrlCreateMenu ("File") $exititem = GuiCtrlCreateMenuitem ("Exit",$filemenu) $helpmenu = GuiCtrlCreateMenu ("Help!") $webitem = GuiCtrlCreateMenuitem ("Backup Website",$helpmenu) $guideitem = GuiCtrlCreateMenuitem ("Setup Guide",$helpmenu) $aboutitem = GuiCtrlCreateMenuitem ("About Backup",$helpmenu) GuiCtrlCreatePic("qbackup.gif",0,2, 175,35,$WS_EX_TRANSPARENT) GuiCtrlCreatePic("2.gif",575,2, 60,53,$WS_EX_TRANSPARENT) GuiCtrlCreateLabel("Setup Wizard", 5, 35) GuiCtrlCreateLabel("Version " & $v & " © 2006 Qual-IT", 5, 50) GuiCtrlCreateLabel("Select shared folders on other computers to backup (optional).", 5, 80) GuiCtrlCreateLabel("Use the Clear button to clear your selections. This section is for specifying up to 60 network shares.", 5,93 ) GuiCtrlCreateLabel("If you are stuck press the Help! button for an explaination of this page, otherwise press Next when done.", 5, 106) GuiCtrlCreateLabel("You currently have the following network shares selected:", 5, 145) $mylist = GUICtrlCreateList("", 5, 165, 270, 165, BitOR($LBS_SORT, $WS_BORDER, $WS_VSCROLL, $LBS_NOTIFY)) ;GUICtrlSetLimit(-1,200); to limit horizontal scrolling GuiCtrlCreateLabel("Passwords for network shares:", 320, 145) GuiCtrlCreateLabel("Some network resources require authentication. If you need to", 320, 165) GuiCtrlCreateLabel("supply a username and password to access one or more of your", 320, 178) GuiCtrlCreateLabel("your network resources you wish to backup, please press", 320, 191) GuiCtrlCreateLabel("the Authentication button below to specify credentials", 320, 204) GuiCtrlCreateLabel("that may be needed for Backup to access other machines.", 320, 217) $authbutton = GuiCtrlCreateButton ("Authentication",380,300,70,20) $advbutton = GuiCtrlCreateButton ("Advanced",450,300,70,20) $outlook = GUICtrlCreateRadio("Somebody works on this computer and it has Microsoft Outlook or Outlook Express e-Mail.", 5, 365) $exchange = GUICtrlCreateRadio("This computer is an unattended Server and has Microsoft Exchange Installed.", 5, 383) $nonms = GUICtrlCreateRadio("This computer is an unattended Server and has a non Microsoft e-Mail system installed.", 5, 401) $Add = GuiCtrlCreateButton ("Add",5,315,70,20) $removebutton = GuiCtrlCreateButton ("Remove",80,315,70,20) $clearbutton = GuiCtrlCreateButton ("Clear",155,315,70,20) $helpbutton = GuiCtrlCreateButton ("Help!",414,435,70,20) $quitbutton = GuiCtrlCreateButton ("Quit",489,435,70,20) $nextbutton = GuiCtrlCreateButton ("Next >>",564,435,70,20) $backbutton = GuiCtrlCreateButton ("<< Back",5,435,70,20) GuiSetState() for $i = 1 to Ubound ($Folders) -1 $sArrayString = _ArrayToString($folders,@TAB, $i,$i ) GUICtrlSetData($mylist, $sArrayString) next While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE $answer = MsgBox(262148, "Backup", "You are about to quit without saving your changes. Press Next to complete the next step. Backup will not operate correctly until you complete this Wizard. Are you sure?") If $answer = 6 Then exit EndIf Case $msg = $quitbutton $answer = MsgBox(262148, "Backup", "You are about to quit without saving your changes. Press Next to complete the next step. Backup will not operate correctly until you complete this Wizard. Are you sure?") If $answer = 6 Then exit EndIf Case $msg = $helpbutton MsgBox(262208, "Backup", "I fucking need help not you") Case $msg = $nextbutton ;Call ( Save ( ) ) MsgBox(262208, "Backup", "Settings saved!") Case $msg = $exititem ExitLoop Case $msg = $removebutton $ret = _GUICtrlListGetSelItemsText ($mylist) If (Not IsArray($ret)) Then MsgBox(262192, "Backup", "Nothing selected to remove!") Else ;For $i = 1 To $ret[0] ;MsgBox(262208, "Selected", $ret[$i]) ;Next EndIf $ret = _GUICtrlListSelectedIndex ($mylist) ;MsgBox(4, "Testdata", $ret) $aret=( $ret + 1 ) _GUICtrlListDeleteItem($mylist, $ret) Case $msg = $authbutton $ret = _GUICtrlListGetSelItemsText ($mylist) If (Not IsArray($ret)) Then MsgBox(262192, "Backup", "No shares selected to specify authentication for. Please select a share in the left hand part of this section.") Else #region --- GuiBuilder code Start --- $Sub = GuiCreate($Ret[1], 392, 316,-1, -1 , BitOR($WS_OVERLAPPEDWINDOW, $WS_CLIPSIBLINGS)) $userName = GuiCtrlCreateInput("", 160, 40, 170, 20) $password = GuiCtrlCreateInput("", 160, 80, 170, 20) $Label_1 = GuiCtrlCreateLabel("User Name", 50, 40, 90, 20) $Label_2 = GuiCtrlCreateLabel("Password", 50, 80, 90, 20) $Submit = GuiCtrlCreateButton("Submit", 130, 130, 110, 30) GuiSetState() GuiSetState (@sw_hide, $Main) While 1 $msg = GuiGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case $Msg = $Submit $User = GuiCtrlRead ($userName) $Pass = GuiCtrlRead ($Password) iniWrite ("~netfldr.tmp", $Ret[1], "User" ,$User) iniWrite ("~netfldr.tmp", $Ret[1], "Password" ,$pass) GuiSetState (@sw_show, $Main) GuiDelete ($Sub) exitloop Case Else ;;; EndSelect WEnd ;For $i = 1 To $ret[0] ;MsgBox(262208, "Selected", $ret[$i]) ;Next EndIf GUICreate("Backup" & " version " & $v & " Network Authentication",320,200) $mylist = GUICtrlCreateList("", 5, 165, 270, 165, BitOR($LBS_SORT, $WS_BORDER, $WS_VSCROLL, $LBS_NOTIFY)) $ret = _GUICtrlListSelectedIndex ($mylist) ;MsgBox(4, "Testdata", $ret) $aret=( $ret + 1 ) _GUICtrlListDeleteItem($mylist, $ret) Case $msg = $clearbutton $answer = MsgBox(262148, "Backup", "This will permanently remove ALL the selected folders from your backup. Are you sure?") If $answer = 6 Then _GUICtrlListClear ($mylist) for $i = 0 to 100 _ArrayDelete ( $folders,$i ) next FileClose ( "~netfldr.tmp" ) FileDelete ( "~netfldr.tmp" ) EndIf Case $msg = $Add $selerr = 0 For $i = 1 to 1 $var = FileSelectFolder("Choose a folder to backup!", "") if @error = 1 Then exitloop $drivetype = DriveGetType( $var ) ; for testing the drive type! ;MsgBox(4096, "Backup", $drivetype) if $drivetype = "Removable" Then MsgBox(262160, "Backup", "Sorry you cannot backup floppy or removable drives!") exitloop EndIf if $drivetype = "CDROM" Then MsgBox(262160, "Backup", "Sorry you cannot backup CD-ROM or DVD-ROM Drives!") exitloop EndIf if $drivetype = "Fixed" Then MsgBox(262160, "Backup", "Local disks are backed up in the previous part of this Wizard (step 1)!") exitloop EndIf if $drivetype = "" Then MsgBox(262160, "Backup", "Sorry you cannot backup this location!") exitloop EndIf $var2 = $var $var2 = StringSplit(StringTrimRight($var2,1),"\") $var2 = "" & $var2[1] & "\" ;msgbox(4,"var2",$var2) For $i = 65 to 90 $checkfldr = StringInStr ( Chr ($i) & ":\", $var2 ) if $checkfldr = 1 Then $selerr = 1 MsgBox(262208, "Backup", "Your selection includes a drive on your system " & $var2 & " that cannot be added to the backup. Please browse for network shares in My Network Places. Please press the Help! button if you do not understand.") EndIf Next if not $selerr = 1 Then $var = StringSplit(StringTrimLeft($var,2),"\") $var = "\\" & $var[1] & "\" & $var[2] _ArrayAdd ( $folders, $var ) GUICtrlSetData($mylist, $var) iniwrite ("~netfldr.tmp", $Var,"Name",$Var) ;call ( Save () ) EndIf Next Case $msg = $aboutitem Case $msg = $guideitem Msgbox(262208,"Guide", "This will display the full setup guide.") Case $msg = $webitem _RunDos("start /max http://www.qualit-uk.com/backup") EndSelect WEnd GUIDelete() Exit #cs Func Save ( ) $Pos1 = _ArrayToString($folders,@TAB, 1, 1 ) ;_ArrayDisplay( $folders, "_ArrayDisplay() Test" ) if $Pos1 = "" THEN exit If FileExists("~netfldr.tmp") Then FileDelete ( "~netfldr.tmp" ) CALL ( Folders ( ) ) CALL ( _ArrayRemoveDupes($folders) ) _ArraySort( $folders ) ;_ArrayDisplay( $folders, "_ArrayDisplay() Test" ) _FileWriteFromArray("~netfldr.tmp",$folders,1) $file=FileClose("~netfldr.tmp") EndIf $txtsize = FileGetSize("~netfldr.tmp") if $txtsize = 0 then FileDelete ( "~netfldr.tmp" ) endif If FileExists("~netfldr.tmp") Then _FileReadToArray("~netfldr.tmp",$folders) Else $file = FileOpen("~netfldr.tmp", 1) _FileReadToArray("~netfldr.tmp",$folders) _ArrayDelete($folders,0) EndIf ;_ArrayDisplay( $folders, "_ArrayDisplay() Test" ) If FileExists("~netfldr.tmp") Then FileDelete ( "~netfldr.tmp" ) CALL ( Folders ( ) ) CALL ( _ArrayRemoveDupes($folders) ) if not $aret = "" THEN _ArrayDelete ( $folders, $aret ) Endif _ArraySort( $folders ) ;_ArrayDisplay( $folders, "_ArrayDisplay() Test" ) _FileWriteFromArray("~netfldr.tmp",$folders,1) $file=FileClose("~netfldr.tmp") EndIf EndFunc #ce #cs Func Folders ( ) $folders = _ArrayRemoveDupes($folders) EndFunc Func _ArrayRemoveDupes($InArray) Dim $TempArray[$InArray[0]+1][2] $TempArray[0][0] = $InArray[0] For $x = 1 to $InArray[0] $TempArray[$x][0] = $InArray[$x] $TempArray[$x][1] = $x Next $n = $temparray[0][0] $h = 1 While $h <= $n/3 $h = $h * 3 + 1 WEnd While $h >0 For $outer = $h To $n $temp = $temparray[$outer][0] $temp2 = Number(StringStripWS($temparray[$outer][1],1)) $inner = $outer While $inner > ($h - 1) And StringLower($temparray[$inner-$h][0]) >= StringLower($temp) $temparray[$inner][0] = $temparray[$inner-$h][0] $temparray[$inner][1] = $temparray[$inner-$h][1] $inner = $inner - $h WEnd $temparray[$inner][0] = $temp $temparray[$inner][1] = $temp2 Next $h = ($h - 1)/3 WEnd For $blah = 1 To $temparray[0][0]-1 If $TempArray[$blah][0] = $temparray[$blah + 1][0] Then _ArrayDelete($InArray,$temparray[$blah][1]) $InArray[0] = $InArray[0]-1 EndIf Next Return($InArray) EndFunc #ce Func _FileSearch($szMask,$nOption) $szRoot = "" $hFile = 0 $szBuffer = "" $szReturn = "" $szPathList = "*" Dim $aNULL[1] If Not StringInStr($szMask,"\") Then $szRoot = @SCRIPTDIR & "\" Else While StringInStr($szMask,"\") $szRoot = $szRoot & StringLeft($szMask,StringInStr($szMask,"\")) $szMask = StringTrimLeft($szMask,StringInStr($szMask,"\")) Wend EndIf If $nOption = 0 Then _FileSearchUtil($szRoot, $szMask, $szReturn) Else While 1 $hFile = FileFindFirstFile($szRoot & "*.*") If $hFile >= 0 Then $szBuffer = FileFindNextFile($hFile) While Not @ERROR If $szBuffer <> "." And $szBuffer <> ".." And _ StringInStr(FileGetAttrib($szRoot & $szBuffer),"D") Then _ $szPathList = $szPathList & $szRoot & $szBuffer & "*" $szBuffer = FileFindNextFile($hFile) Wend FileClose($hFile) EndIf _FileSearchUtil($szRoot, $szMask, $szReturn) If $szPathList == "*" Then ExitLoop $szPathList = StringTrimLeft($szPathList,1) $szRoot = StringLeft($szPathList,StringInStr($szPathList,"*")-1) & "\" $szPathList = StringTrimLeft($szPathList,StringInStr($szPathList,"*")-1) Wend EndIf If $szReturn = "" Then $aNULL[0] = 0 Return $aNULL Else Return StringSplit(StringTrimRight($szReturn,1),"*") EndIf EndFunc Func _FileSearchUtil(ByRef $ROOT, ByRef $MASK, ByRef $RETURN) $hFile = FileFindFirstFile($ROOT & $MASK) If $hFile >= 0 Then $szBuffer = FileFindNextFile($hFile) While Not @ERROR If $szBuffer <> "." And $szBuffer <> ".." Then _ $RETURN = $RETURN & $ROOT & $szBuffer & "*" $szBuffer = FileFindNextFile($hFile) Wend FileClose($hFile) EndIf EndFunc Edited February 27, 2006 by ChrisL [u]Scripts[/u]Minimize gui to systray _ Fail safe source recoveryMsgbox UDF _ _procwatch() Stop your app from being closedLicensed/Trial software system _ Buffering Hotkeys_SQL.au3 ADODB.Connection _ Search 2d Arrays_SplashTextWithGraphicOn() _ Adjust Screen GammaTransparent Controls _ Eventlogs without the crap_GuiCtrlCreateFlash() _ Simple Interscript communication[u]Websites[/u]Curious Campers VW Hightops Lambert Plant Hire
crystalburner Posted February 27, 2006 Author Posted February 27, 2006 Okay This piece of code reads the text file that is written and puts [ ] brackets around each entry writing it to a new file the original text file is \\nick\test1 \\ken\test2 the resulting file is [\\nick\test1] [\\nick\test2] perhaps i can then use this like an ini file with a seperate gui that asks for users and pwds and then adds them to the sections in the new ini. section names being sharenames but how can i make a gui that shows you this \\nick\test1 [enter username] [enter password] \\ken\test2 [enter username] [enter password] here is the code if it helps anyone else DIM $folders $file = FileOpen("~netfldr.tmp", 1) _FileReadToArray("~netfldr.tmp",$folders) _ArrayDisplay( $folders, "Test" ) $CountLines = _FileCountLines("~netfldr.tmp") for $i = 1 to $countlines ;fileopen ("test.txt") $sArrayString = _ArrayToString($folders,@TAB, $i,$i ) FileWriteLine ( "test.txt", "[" & $sArrayString & "]" ) next
crystalburner Posted February 27, 2006 Author Posted February 27, 2006 I have just seen what you did above that looks interesting or maybe its better to go the approach above and write a seperate exe to do the auth? still my same question from a long time now is how the hell to make the GUI! how do i display the machine names and ask for the pwds?
ChrisL Posted February 27, 2006 Posted February 27, 2006 (edited) Maybe I'm getting a bit lost with what your asking. Currently with what i modified, you have a list of computershares in the left, if you click on one and click the Authentication button you get a new GUI which alows you to input the username and password which is then all stored in the ini file (Note the title of the new GUI is the computername\share. I'm not doing the whole read file to array thing anymore. If you want to get a list of all the PC shares you read all of the section names (inireadsectionnames()) which stores them to an array, once you have all of the section names you know how many sections are in the ini file, so armed with this information you can set up a For loop to go and get all of your usernames and passwords by reading the ini file using IniRead ( "filename", "section from the array", "UserName", "" ) and IniRead ( "filename", "section from the array", "Password", "" ) Does this make sense or have I got it arse about face? Edited February 27, 2006 by ChrisL [u]Scripts[/u]Minimize gui to systray _ Fail safe source recoveryMsgbox UDF _ _procwatch() Stop your app from being closedLicensed/Trial software system _ Buffering Hotkeys_SQL.au3 ADODB.Connection _ Search 2d Arrays_SplashTextWithGraphicOn() _ Adjust Screen GammaTransparent Controls _ Eventlogs without the crap_GuiCtrlCreateFlash() _ Simple Interscript communication[u]Websites[/u]Curious Campers VW Hightops Lambert Plant Hire
crystalburner Posted February 27, 2006 Author Posted February 27, 2006 i've been playing with your modified file attached but im a bit stumped as to why when you run it, you can select a list item and specify authentication but afterwards anything you select says "sorry, you have selected nothing!"
ChrisL Posted February 27, 2006 Posted February 27, 2006 That is what I was saying about it only works once, I had that same problem with your original script. I haven't bothered trying to figure that out yet because I wasn't sure if I was on the right lines with what I have already done! [u]Scripts[/u]Minimize gui to systray _ Fail safe source recoveryMsgbox UDF _ _procwatch() Stop your app from being closedLicensed/Trial software system _ Buffering Hotkeys_SQL.au3 ADODB.Connection _ Search 2d Arrays_SplashTextWithGraphicOn() _ Adjust Screen GammaTransparent Controls _ Eventlogs without the crap_GuiCtrlCreateFlash() _ Simple Interscript communication[u]Websites[/u]Curious Campers VW Hightops Lambert Plant Hire
crystalburner Posted February 27, 2006 Author Posted February 27, 2006 That is what I was saying about it only works once, I had that same problem with your original script.I haven't bothered trying to figure that out yet because I wasn't sure if I was on the right lines with what I have already done!i dont know. i want to jump off a cliff!it looks like what i needis it possible to write the sections out like soset share00=\\first\shareset shareuser00=adminset sharepass00=pass1set share01=\\second\shareset shareuser01=set sharepass01=set share02=\\third\shareset shareuser00=admin3set sharepass00=pass3If the answer is yes you hit the nail on the head and I am willing to pay for your time if you can do that
ChrisL Posted February 27, 2006 Posted February 27, 2006 At what point do you want it to do this? Is the point that a person sets up all of the folders they want to backup, then at the end you want to have an ini file that stores the data as it is now and then generate a new file like your one above? Remember I have no clue what you actually want to do, I'm just trying to figure it out from your code Also I may have to look tomorrow its getting late now! [u]Scripts[/u]Minimize gui to systray _ Fail safe source recoveryMsgbox UDF _ _procwatch() Stop your app from being closedLicensed/Trial software system _ Buffering Hotkeys_SQL.au3 ADODB.Connection _ Search 2d Arrays_SplashTextWithGraphicOn() _ Adjust Screen GammaTransparent Controls _ Eventlogs without the crap_GuiCtrlCreateFlash() _ Simple Interscript communication[u]Websites[/u]Curious Campers VW Hightops Lambert Plant Hire
crystalburner Posted February 27, 2006 Author Posted February 27, 2006 this is what i am trying to acheive at the end of this, as i said im struggling badly, im knackered and really i would pay you (paypal, cheque etc) to do this if ur interested, this is what i need it to produce (the text file my batch file is going to run to get env variables to operate) @echo off set mapdrv00=server1\share set mapdrv01=nick\my documents set mapdrv02=ken\data set mapdrv03=ken\data2 set mapdrv04=ken\data3 set mapdrv05=ken\data4 set mapdrv06=ken\data5 set mapdrv07=ken\data6 set mapdrv08=ken\data7 set mapdrv09=ken\data8 set mapdrv0A=ken\data9 set mapdrv0B=ken\data0 set mappath00=server1\share set mappath01=server2\share2 set mappath02=ken\data set mappath03=ken\data1 set mappath04=james\files set mappath05=sue\docs set mappath06=jim\folders set mappath07=ken\accounts set mappath08=jim\photos set mappath09=phil\porno set mappath00=john\text set mappath0A=phil\machine set mappath0B=sal\music (yes its hex count, and note no leading "\\") set mapuser00= set mapuser01= set mapuser02= set mapuser03= set mapuser04=jamesp set mapuser05= (hex as well, any or all lines can be blank) set mappass00= set mappass01= set mappass02= set mappass03= set mappass04=jamespw1 set mappass05= (also hex any or all lines can be blank)
crystalburner Posted February 27, 2006 Author Posted February 27, 2006 sorry that should be! set mappath00=server1\share set mappath01=server2\share2 set mappath02=ken\data set mappath03=ken\data1 set mappath04=james\files set mappath05=sue\docs set mappath06=jim\folders set mappath07=ken\accounts set mappath08=jim\photos set mappath09=phil\porno set mappath00=john\text set mappath0A=phil\machine set mappath0B=sal\music (yes its hex count, and note no leading "\\") set mapuser00= set mapuser01= set mapuser02= set mapuser03= set mapuser04=jamesp set mapuser05= (hex as well, any or all lines can be blank) set mappass00= set mappass01= set mappass02= set mappass03= set mappass04=jamespw1 set mappass05= (also hex any or all lines can be blank)
ChrisL Posted February 27, 2006 Posted February 27, 2006 I figured out why it only works once.. You reuse $mylist here and it all goes to cock! GUICreate("Backup" & " version " & $v & " Network Authentication",320,200) $mylist = GUICtrlCreateList("", 5, 165, 270, 165, BitOR($LBS_SORT, $WS_BORDER, $WS_VSCROLL, $LBS_NOTIFY)) $ret = _GUICtrlListSelectedIndex ($mylist) ;MsgBox(4, "Testdata", $ret) $aret=( $ret + 1 ) _GUICtrlListDeleteItem($mylist, $ret) [u]Scripts[/u]Minimize gui to systray _ Fail safe source recoveryMsgbox UDF _ _procwatch() Stop your app from being closedLicensed/Trial software system _ Buffering Hotkeys_SQL.au3 ADODB.Connection _ Search 2d Arrays_SplashTextWithGraphicOn() _ Adjust Screen GammaTransparent Controls _ Eventlogs without the crap_GuiCtrlCreateFlash() _ Simple Interscript communication[u]Websites[/u]Curious Campers VW Hightops Lambert Plant Hire
ChrisL Posted February 27, 2006 Posted February 27, 2006 So.. you add the computers into the left pane, add authentication if required, then click Next is this when you want it to generate the file? I really am going to bed now, I'll check back tomorrow [u]Scripts[/u]Minimize gui to systray _ Fail safe source recoveryMsgbox UDF _ _procwatch() Stop your app from being closedLicensed/Trial software system _ Buffering Hotkeys_SQL.au3 ADODB.Connection _ Search 2d Arrays_SplashTextWithGraphicOn() _ Adjust Screen GammaTransparent Controls _ Eventlogs without the crap_GuiCtrlCreateFlash() _ Simple Interscript communication[u]Websites[/u]Curious Campers VW Hightops Lambert Plant Hire
crystalburner Posted February 27, 2006 Author Posted February 27, 2006 So.. you add the computers into the left pane, add authentication if required, then click Next is this when you want it to generate the file?I really am going to bed now, I'll check back tomorrowYeah thats about it(i didnt add the second $mylist = !) but if you remove it it goes a bit weird!maximum entries in this file should be 60 (i.e. up to mapuser3c, mappass3c and mappath3c)
crystalburner Posted February 27, 2006 Author Posted February 27, 2006 Yeah thats about it(i didnt add the second $mylist = !) but if you remove it it goes a bit weird!maximum entries in this file should be 60 (i.e. up to mapuser3c, mappass3c and mappath3c)maybe show the ones in the list in bold that have had authentication added?
crystalburner Posted February 27, 2006 Author Posted February 27, 2006 maybe show the ones in the list in bold that have had authentication added?here is some little progress and now i really am dead with black eyes like i've been beatenthis one correctly allows you to specify authentication again and again and also now deletes the sections from the ini file correctly when you press the remove button.Perhaps a seperate .exe is required now after the screen is closed to read the ini file and write out the set xxxxx = linesThere is also one text file from screen one that just contains a list of foldersc:\kenc:\jimc:\bilthat also need writing out to a text file likeset srcfldr00=c:\kenset srcfldr01=c:\jimetcalso in hexmaybe we can use the same .exe to compile all the text files?Ok, its getting there!!!!
crystalburner Posted February 28, 2006 Author Posted February 28, 2006 whoops here is thefile! okay here we go I have made some progress, i think i am going to collect data on this screen test.au3, and the other screens i have made. if you run test. au3 it creates ~netfldr.tmp this code puts the ~netfldr.tmp file in the format i need perfectly we're making some progress im not about tomorrow tueday but will speak as soon as i am back hold off any changes for the moment thank you for the ini idea, i will speak to you again when i am back #include<Array.au3> #include<File.au3> #include <String.au3> #NoTrayIcon filedelete ("test.txt") $var = IniReadSectionNames("~netfldr.tmp") If @error Then MsgBox(4096, "", "~netfldr.tmp missing!") Else For $i = 1 To $var[0] $var2=StringTrimLeft ( $var[$i], 2 ) $tmp = $i - 1 $result = Hex($tmp, 2) FileWriteLine ( "test.txt", "set mappath" & $result & "=" & $var2 ) ; MsgBox(4096, "", $var2) Next EndIf
crystalburner Posted February 28, 2006 Author Posted February 28, 2006 perfect converts the ~netfldrs.txt into exactly what i need thats it apart from can we mark the selections in the list? will be back in 24-48hrs #include<Array.au3> #include<File.au3> #include <String.au3> #NoTrayIcon filedelete ("test.txt") $var = IniReadSectionNames("~netfldr.tmp") If @error Then MsgBox(4096, "", "~netfldr.tmp missing!") Else For $i = 1 To $var[0] $user = IniRead("~netfldr.tmp", $var[$i], "User", "") $pass = IniRead("~netfldr.tmp", $var[$i], "Password", "") $var2=StringTrimLeft ( $var[$i], 2 ) $tmp = $i - 1 $result = Hex($tmp, 2) FileWriteLine ( "test.txt", "set mappath" & $result & "=" & $var2 ) FileWriteLine ( "test.txt", "set mapuser" & $result & "=" & $user ) FileWriteLine ( "test.txt", "set mappass" & $result & "=" & $pass ) Next EndIf
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