Jump to content

Kiesp

Active Members
  • Posts

    103
  • Joined

  • Last visited

Everything posted by Kiesp

  1. Thanks, that works I was just hoping that there might have been a buildin function for it, since missing data can serve as a big problem.
  2. Hi. I'm trying to get info on a bunch of users and looping through them, I use the following to get the data for each user $userdata = _AD_GetObjectProperties($user,"mail,physicalDeliveryOfficeName,department,pwdLastSet") I've found that, if the userobject is missing one (or more) of the properties, the row is just missing from my array. This means that the following code might not actually get me the mail of the use, if there's no mail defined on the object in AD. $mail = $userdata[2][1] Is there any way to keep the row in my array, but simply just leave the value blank ? Thanks in advance, Kiesp
  3. It appears to be the network location I'm trying to copy to. I can copy the folder as many times to any other location, but if I try to copy the folder to the P drive i randomly chooses to return failure and succeeds codes. Guess I'll have to check if the folder copied some other way. Thanks for the help though
  4. Hi. I am trying to copy a folder using the DirCopy function and the copying goes fine, but the function returns 0 as if it failed. This is my code: $home = "P:\IT\Backup\" If FileExists(@AppDataDir & "\Microsoft\Signaturer") Then If DirCopy(@AppDataDir & "\Microsoft\Signaturer", $home & "Signaturer", 1) = 0 Then Exit (2) Else Exit (1) EndIf I tried replacing the 1 to a 0 in the flag parameter, this doesnt change anything. Am I missing something or is this a bug in the function ?
  5. Nvm.. I found out how to do it. Just use the _ftp_filerename function and then use full paths _FTP_FileRename($conn,"/place/to/move/from/file.name", "/place/to/move/to/file.name") hope it helps someone else
  6. the script seems to be working just as i want it to with my changes, so i thank you alot for your help edit: ah.. just realised that i cant use the arrow buttons to change position in the text unless i got your if in the loop ^^ i'll bring it back
  7. it doesnt really matter if i have $ES_NUMBER or not.. im not allowed to make spaces either way.. i'll just leave it there
  8. Once again, thanks Andreik I changed the code a bit so now it almost fits my needs Global $MAIN, $INPUT, $LAST #Include <GuiEdit.au3> #include <EditConstants.au3> $MAIN = GUICreate("Example",200,200) $INPUT = GUICtrlCreateInput("",50,90,100,20,$ES_NUMBER) GUISetState(@SW_SHOW,$MAIN) _GUICtrlEdit_SetLimitText($INPUT,11) AdlibRegister("CheckInput") While True Switch GUIGetMsg() Case -3 AdlibUnRegister("CheckInput") Exit EndSwitch Sleep(10) WEnd Func CheckInput() $TEXT = GUICtrlRead($INPUT) ;If $TEXT <> $LAST Then $MASK = StringRegExpReplace($TEXT,"(?x)[^[:digit:]]","") $LAST = StringStripWS(StringMid($MASK,1,2) & " " & StringMid($MASK,3,2) & " " & StringMid($MASK,5,2) & " " & StringMid($MASK,7,2),2) GUICtrlSetData($INPUT,$LAST) ;EndIf EndFunc but i was thinking is there a way for i can get rid of the "$MASK = StringRegExpReplace($TEXT,"(?x)[^[:digit:]]","")" line, since it just seems like double work since i use $ES_NUMBER like taietel suggested ?
  9. Ya, i guess i could just do that ^^What i actually wanted was the underscores marking how much and where to write and also the spaces
  10. Thanks alot I was looking for something that looks abit like the attached image asd.bmp I just realized it didnt attach my picture on the first post, so i'll try again I hope its possible
  11. Could you give me a headstart on how to do this ?
  12. Hi. I was wondering if its possible in some way to make a Masked Text Box in autoit. I want to use it for users to enter a phone number and to make sure they write it in the correct format (__ __ __ __) and dont use illegal characters and such. Is this possible ?
  13. The title says it all Is there a way to move a file on a ftp server ? I know i can just download the file and then reupload it to the new location and then delete the original file, but is there a easier, and possibly faster way ? Greets Kiesp
  14. Looks nice
  15. A little bump to say thanks Helped me alot in the right direction
  16. Nice program.. using it for listening to music atm But the play/pause button is showing the wrong text.. (showing the pause button when the music is paused and play button when its playing)
  17. Ya.. thats not a bad idea either Except for one small problem.. Im on the job ^^Anyways.. i got it working thanks to you guys so thanks ALOT! u saved me hours and probably half of my hair ^^
  18. Took at break, listened to some music and talked to some friends. Looked at the code again and now i can see that it helps me Thanks for pointing it out I shall return shortly and tell u if i got it working or not
  19. Thats very nice But it doesn't really solve my problem
  20. #include <WindowsConstants.au3> #Include <File.au3> #Include <Array.au3> #include <GUIConstantsEx.au3> Opt("TrayIconHide",1) Global $name, $i, $names,$navne, $ophei $o = 0 $q = 0 $l = 5 $t = 5 if Not FileExists("Servicedesk personer.txt") Then fejl() EndIf if _FileReadToArray("Servicedesk personer.txt",$navne) = 0 Then fejl() _ArrayAdd($navne,"") _ArrayAdd($navne,"") Global $variables[$navne[0]] for $q = 0 To $navne[0] Step 2 $ophei += 22 Next $maingui = GUICreate("Servicedesk.",150,70,-1,-1,-1,BitOR($WS_EX_TOOLWINDOW,$WS_EX_APPWINDOW)) $roll1 = GUICtrlCreateButton(" Frokost ",30,10) $roll2 = GUICtrlCreateButton(" Møde ",30,40) $opt = GUICtrlCreateButton(" Mere ",110,25) GUISetState(@SW_SHOW,$maingui) $optiongui = GUICreate("",165,$ophei,-1,-1,-1,$WS_EX_TOOLWINDOW,$maingui) for $w = 1 To $navne[0] $qq = $navne[$w] guictrlcreatecheckbox($navne[$w],$l,$t) ;MsgBox(0,"",guictrlgetstate($qq)) ;MsgBox(0,"",GUICtrlGetHandle("[CLASS:Button; INSTANCE:1]")) GUICtrlSetState($navne[$w],$GUI_CHECKED) if $l = 5 Then $l = 100 Else $l = 5 $t += 25 EndIf Next while 1 $msg = GUIGetMsg(1) Select Case $msg[0] = -3 And $msg[1] = $maingui Exit case $msg[0] = $roll1 GUICtrlDelete($roll1) GUICtrlDelete($roll2) GUICtrlDelete($opt) shuffle(2) GUISetState(@sw_hide,$optiongui) case $msg[0] = $roll2 MsgBox(0,"",GUICtrlGetHandle("[CLASS:Button; INSTANCE:1]")) GUICtrlDelete($roll1) GUICtrlDelete($roll2) GUICtrlDelete($opt) shuffle(1) GUISetState(@sw_hide,$optiongui) Case $msg[0] = -3 And $msg[1] = $optiongui GUISetState(@sw_hide,$optiongui) Case $msg[0] = $opt GUISetState(@SW_SHOW,$optiongui) EndSelect WEnd Func fejl() if MsgBox(68,"Fejl","Du har ikke skrevet noget i ''Servicedesk personer.txt''" & @CRLF & "Vil du åbne filen ?") = 6 Then $SSDH = FileOpen("Servicedesk personer.txt",9) FileClose($SSDH) ShellExecuteWait(@ScriptDir & "\" & "Servicedesk personer.txt") if _FileReadToArray("Servicedesk personer.txt",$navne) = 0 then Exit Else Exit EndIf EndFunc func shuffle($nrop) $totalnavne = $navne[0] for $i = 1 to $nrop $rand = Random(1,$totalnavne,1) if $navne[$rand] = "" Then $name = $navne[$rand + 1] ;if $navne[$rand] = "" Then $name = $navne[$rand - 2] Else $name = $navne[$rand] EndIf $navne[$rand] = "" $names = $names & $name & "," Next if $nrop = 2 Then $names = StringSplit($names,",") $names = $names[1] & " og " & $names[2] $section = "Frokost" $lbl = GUICtrlCreateLabel($names,10,5,140,30) GUICtrlSetFont($lbl,12,600) GUICtrlCreateLabel("Skal til frokost",35,40) Else $names = StringTrimRight($names,1) $section = "Møde" $lbl = GUICtrlCreateLabel($names,40,5,90,30) GUICtrlSetFont($lbl,12,600) GUICtrlCreateLabel("Skal blive på telefonen",15,40) EndIf IniWrite("Servicedesk.log",$section,@MDAY & "/" & @MON & "-" & @YEAR,$names) EndFunc Please dont criticize my messy code This is the part that i tried with so far $qq = $navne[$w] guictrlcreatecheckbox($navne[$w],$l,$t) ;MsgBox(0,"",guictrlgetstate($qq)) ;MsgBox(0,"",GUICtrlGetHandle("[CLASS:Button; INSTANCE:1]")) GUICtrlSetState($navne[$w],$GUI_CHECKED)
  21. Can you give an example ? I think that i have "starred myself blind" on the code. my code is still very messy.. and i dont have anything major in it. can post of needed though
  22. I would like to create an unknown number of checkboxes in my gui. The number of checkboxes are decided by a file. It simply counts the number of lines. This is not the problem. The problem is that i would like to be able to read the state of these checkboxes. But to do that i need a controlname (correct me if im wrong) How can i create checkboxes with controlnames dynamicly. The problem is that there can be between 3 and 100 lines in this file. Thanks in advance Kiesp
  23. Ah Thanks for the clarification
  24. I'm sorry, but then i have no idea how to do it. Let's hope someone else knows
×
×
  • Create New...