Jump to content

jslegers

Active Members
  • Posts

    60
  • Joined

  • Last visited

jslegers's Achievements

Wayfarer

Wayfarer (2/7)

0

Reputation

  1. Got it Notepad was broken at this side. Sorry guys for this noob question.
  2. Hello, I have made the following script : #include <MsgBoxConstants.au3> If @ProcessorArch = "X86" Then MsgBox($MB_OK, "Tutorial", "32 Bit") Run("tc86\calc.exe", "") Else MsgBox($MB_OK, "Tutorial", "64 Bit") Run("tc64\notepad.exe", "") EndIf I can't get in this case notepad run from the subdirectory tc64. I have also tried .\tc64\notepad.exe and ..\tc64\notepad.exe no luck with both. What am I doing wrong ?
  3. Hello, I'm using this script at a customer of mine to cleanup locale user profiles : Const LocalDocumentsFolder = "C:\Documents and Settings\" set objFSO = createobject("Scripting.FileSystemObject") set objFolder = objFSO.GetFolder(localdocumentsfolder) on error resume next for each fldr in objFolder.SubFolders if not isexception(fldr.name) then objFSO.DeleteFolder fldr.path, True end if next Function isException(byval foldername) select case foldername case "All Users" isException = True case "Default User" isException = True case "LocalService" isException = True case "NetworkService" isException = True case "Administrator" isException = True case "Nood" isException = True case Else isException = False End Select End Function Is there an Autoit version for this. Would be nice if the exceptions could be set in a ini file. John
  4. Hello, I have seen this topic : http://www.autoitscript.com/forum/index.php?showtopic=110281&st=0&p=775935&hl=nfo&fromsearch=1&#entry775935 Is it possible to run this script on files in sub directories ? Example structure : [Dir] Movie1 Movie1.mkv [Dir] Movie2 Movie2.mkv [Dir] Movie3 Movie3.mkv Result : [Dir] Movie1 Movie1.mkv Movie1.nfo [Dir] Movie2 Movie2.mkv Movie2.nfo [Dir] Movie3 Movie3.mkv Movie3.nfo The .nfo files need to be filled with an url of IMDB I will copy and paste that. And if there is already an .nfo file it needs to skip the directory before it clears the old .nfo file. John
  5. Hello, I want to create a script that can read a csv file and use this data to create users in Active Directory with the tool dsadd. CSV file looks like this : ABeerens;Ans Beerens;Ans;Beerens;Welkom01 ABos;Annemiek Bos;Annemiek;Bos;Welkom01 ABraat;Ans Braat;Ans;Braat;Welkom01 Is it possible to create variables from the different pieces in the file. For example $Var1=ABeerens $Var2=Ans Beerens $Var3=Ans $Var4=Beerens $Var5=Welkom01 dsadd $Var1,Var2 .... Loop And so on. I want to create a loop until the end of the file is reached.
  6. Hi, I have used this code : #include <Array.au3> $Numbers = 10 $Range = 80 Local $aRandom[$Numbers+1] = ["Generated numbers"] For $i = 1 To $Numbers $aRandom[$i] = Random(1, $Range, 1) For $j = 1 To $i If $i = $j Then ContinueLoop If $aRandom[$i] = $aRandom[$j] Then $i -= 1 Next $Result1 = $aRandom[$i] & $Result1 Next _ArraySort($aRandom ,0 ,1) ;_ArrayDisplay($aRandom, "Lotto") $Result1 = $aRandom[1]&" "&$aRandom[2]&" "&$aRandom[3]&" "&$aRandom[4]&" "&$aRandom[5] MsgBox ( 4096, "Test", $Result1 ) Is it possible to make $Result1 = $Result1&" "&$aRandom[$i]&" " so that the results get added in one line.
  7. Hi, Easier as in smaller like you did. Looks great. Thanks for the input.
  8. Hello, I have created a Lotto Generator for fun. #include <Array.au3> #include <GuiConstants.au3> Dim $R[11] Dim $Getal1 ; GUI GuiCreate("Lucky Day Generator", 240, 80, -1, -1) ;GuiCreate("Lucky Day Generator", 240, 120, -1, -1, $WS_BORDER, $WS_EX_TOPMOST) GUICtrlCreateLabel(" ",5 ,20, 240) GUICtrlCreateLabel("Lucky nummers : " ,5, 20) GUISetState() $Genereer = GUICtrlCreateButton("Genereer", 30, 50, 75, 23) $Stoppen = GUICtrlCreateButton("Stoppen", 135, 50, 75, 23) While 1 $msg = GUIGetMsg() If $msg = $GUI_EVENT_CLOSE Then ExitLoop If $msg = $Stoppen Then ExitLoop If $msg = $Genereer Then Randomize() GUICtrlCreateLabel(" ",5 ,20, 240) GUICtrlCreateLabel("Lucky nummers : " & $Getal1, 5, 20) EndIf WEnd Func Randomize() $R[1] = Random(1, 80, 1) $R[2] = Random(1, 80, 1) $R[3] = Random(1, 80, 1) $R[4] = Random(1, 80, 1) $R[5] = Random(1, 80, 1) $R[6] = Random(1, 80, 1) $R[7] = Random(1, 80, 1) $R[8] = Random(1, 80, 1) $R[9] = Random(1, 80, 1) $R[10] = Random(1, 80, 1) If $R[1] = $R[2] Or $R[1] = $R[3] Or $R[1] = $R[4] Or $R[1] = $R[5] Or $R[1] = $R[6] Or $R[1] = $R[7] Or $R[1] = $R[8] Or $R[1] = $R[9] Or $R[1] = $R[10] Then Randomize () If $R[2] = $R[3] Or $R[2] = $R[4] Or $R[2] = $R[5] Or $R[2] = $R[6] Or $R[2] = $R[7] Or $R[2] = $R[8] Or $R[2] = $R[9] Or $R[2] = $R[10] Then Randomize () If $R[3] = $R[4] Or $R[3] = $R[5] Or $R[3] = $R[6] Or $R[3] = $R[7] Or $R[3] = $R[8] Or $R[3] = $R[9] Or $R[3] = $R[10] Then Randomize () If $R[4] = $R[5] Or $R[4] = $R[6] Or $R[4] = $R[7] Or $R[4] = $R[8] Or $R[4] = $R[9] Or $R[4] = $R[10] Then Randomize () If $R[5] = $R[6] Or $R[5] = $R[7] Or $R[5] = $R[8] Or $R[5] = $R[9] Or $R[5] = $R[10] Then Randomize () If $R[6] = $R[7] Or $R[6] = $R[8] Or $R[6] = $R[9] Or $R[6] = $R[10] Then Randomize () If $R[7] = $R[8] Or $R[7] = $R[9] Or $R[7] = $R[10] Then Randomize () If $R[8] = $R[9] Or $R[8] = $R[10] Then Randomize () If $R[9] = $R[10] Then Randomize () _ArraySort($R, 0, 1) $Getal1 = $r[1]&" "&$r[2]&" "&$r[3]&" "&$r[4]&" "&$r[5]&" "&$r[6]&" "&$r[7]&" "&$r[8]&" "&$r[9]&" "&$r[10] EndFunc Is this the best way or could it be made easier? The long If statements are for that I get unique numbers and not the same. John
  9. Hello, I want to make a script that could check on ip address and then perform a installation. Before I begin I want to know if this is possible. I want some thing like : If ip address is in range 10.10.10.1 to 10.10.10.255 than execute program a If ip address is in range 10.10.20.1 to 10.10.20.255 than execute program b Is this possible?
  10. Hi, I have the following code : $var1 = String ( '"' & @ScriptDir & "\new_1.log" & '"' ) $var2 = FileReadLine ( $var1, 2 ) MsgBox ( 4096,"Test",$var2 ) It looks like that FileReadLine can't read filenames with a path between quotes. Files are placed for test : c:\Documents and Settings\JSL\My Documents\Autoit Scripts\Log file\var.au3 Is this a limitation of FileReadLine ?
×
×
  • Create New...