
logonui
Active Members-
Posts
35 -
Joined
-
Last visited
About logonui
- Birthday 08/26/1986
Profile Information
-
Location
Romford, London, UK
logonui's Achievements

Seeker (1/7)
0
Reputation
-
Cheers I tried doing that initially like i do will all of my other scripts but it just kept erroring out, strange but not a major issue. Cheers anyway Lee
-
Hi all, I am having a few problems with a script I am writing, I have managed to create a series of arrays which retrieve the file and folder list for up to 7directory levels and create a tree view showing this. The issues i am having are: 1. The script is kind of messy but I can't think of any way to clean it up 2. It runs stupidly slowly when trying to refresh the tree to include updates that the user has made 3. The program stops running if the folder list reaches 3873 items, is this a limit of AutoIT or am I doing something wrong #include <GUIConstants.au3> #Include <File.au3> #Include <Array.au3> Dim $Tree1[20000] Dim $Tree1A[20000] Dim $Tree2[20000] Dim $Tree2B[20000] Dim $Tree3[20000] Dim $Tree3C[20000] Dim $Tree4[20000] Dim $Tree4D[20000] Dim $Tree5[20000] Dim $Tree5E[20000] Dim $Tree6[20000] Dim $Tree6F[20000] Dim $Tree7[20000] Dim $Tree7G[20000] Global $Tree1[20000] Global $Tree1A[20000] Global $Tree2[20000] Global $Tree2B[20000] Global $Tree3[20000] Global $Tree3C[20000] Global $Tree4[20000] Global $Tree4D[20000] Global $Tree5[20000] Global $Tree5E[20000] Global $Tree6[20000] Global $Tree6F[20000] Global $Tree7[20000] Global $Tree7G[20000] Global $TreeView $1 = GUICreate("GUI",800,600,-1,-1,BitOR($WS_MAXIMIZEBOX,$WS_MINIMIZEBOX,$WS_SIZEBOX)) GUISetBkColor(0xFFFFFF,$1) GUISetFont(10,400,-1,"Arial",$1) $TreeView = GUICtrlCreateTreeView(0,0,800,500) _Populate() GUISetState () While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE Exit EndSelect Wend Func _Populate() $RootFolder = FileSelectFolder ( "Select Folder", "") $FOArray1 = _FileListToArray ($RootFolder, "*",2);Level 1 If IsArray($FOArray1) Then $a = 1 For $1 = 1 To $FOArray1[0] $a = $a + 1 $Tree1[$a] = GUICtrlCreateTreeViewitem($FOArray1[$1], $TreeView) GUICtrlSetColor($Tree1[$a],0x2A2AFF) $FOArray2 = _FileListToArray ($RootFolder&"\"&$FOArray1[$1], "*",2);Level 2 If IsArray($FOArray2) Then $b = 1 For $2 = 1 To $FOArray2[0] $b = $b + 1 $Tree2[$b] = GUICtrlCreateTreeViewitem($FOArray2[$2], $Tree1[$a]) GUICtrlSetColor($Tree2[$b],0x2A2AFF) $FOArray3 = _FileListToArray ($RootFolder&"\"&$FOArray1[$1]&"\"&$FOArray2[$2], "*",2);Level3 If IsArray($FOArray3) Then $c = 1 For $3 = 1 To $FOArray3[0] $c = $c + 1 $Tree3[$c] = GUICtrlCreateTreeViewitem($FOArray3[$3], $Tree2[$b]) GUICtrlSetColor($Tree3[$c],0x2A2AFF) $FOArray4 = _FileListToArray ($RootFolder&"\"&$FOArray1[$1]&"\"&$FOArray2[$2]&"\"&$FOArray3[$3], "*",2);Level 4 If IsArray($FOArray4) Then $d = 1 For $4 = 1 To $FOArray4[0] $d = $d + 1 $Tree4[$d] = GUICtrlCreateTreeViewitem($FOArray4[$4], $Tree3[$c]) GUICtrlSetColor($Tree4[$d],0x2A2AFF) $FOArray5 = _FileListToArray ($RootFolder&"\"&$FOArray1[$1]&"\"&$FOArray2[$2]&"\"&$FOArray3[$3]&"\"&$FOArray4[$4], "*",2);Level 5 If IsArray($FOArray5) Then $e = 1 For $5 = 1 To $FOArray5[0] $e = $e + 1 $Tree5[$e] = GUICtrlCreateTreeViewitem($FOArray5[$5], $Tree4[$d]) GUICtrlSetColor($Tree5[$e],0x2A2AFF) $FOArray6 = _FileListToArray ($RootFolder&"\"&$FOArray1[$1]&"\"&$FOArray2[$2]&"\"&$FOArray3[$3]&"\"&$FOArray4[$4]&"\"&$FOArray5[$5], "*",2);Level 6 If IsArray($FOArray6) Then $f = 1 For $6 = 1 To $FOArray6[0] $f = $f + 1 $Tree6[$f] = GUICtrlCreateTreeViewItem($FOArray6[$6], $Tree5[$e]) GUICtrlSetColor($Tree6[$f],0x2A2AFF) $FOArray7 = _FileListToArray ($RootFolder&"\"&$FOArray1[$1]&"\"&$FOArray2[$2]&"\"&$FOArray3[$3]&"\"&$FOArray4[$4]&"\"&$FOArray5[$5]&"\"&$FOArray6[$6], "*",2);Level 7 If IsArray($FOArray7) Then $g = 1 For $7 = 1 To $FOArray7[0] $g = $g + 1 $Tree7[$g] = GUICtrlCreateTreeViewItem($FOArray7[$7], $Tree6[$f]) GUICtrlSetColor($Tree7[$g],0x2A2AFF) Next EndIf $FIArray7 = _FileListToArray ($RootFolder&"\"&$FOArray1[$1]&"\"&$FOArray2[$2]&"\"&$FOArray3[$3]&"\"&$FOArray4[$4]&"\"&$FOArray5[$5]&"\"&$FOArray6[$6], "*",1) If IsArray($FIArray7) Then $g7 = 1 For $7g = 1 To $FIArray7[0] $g7 = $g7 + 1 $Tree7G[$g7] = GUICtrlCreateTreeViewItem($FIArray7[$7g], $Tree6[$f]) Next EndIf Next EndIf $FIArray6 = _FileListToArray ($RootFolder&"\"&$FOArray1[$1]&"\"&$FOArray2[$2]&"\"&$FOArray3[$3]&"\"&$FOArray4[$4]&"\"&$FOArray5[$5], "*",1) If IsArray($FIArray6) Then $f6 = 1 For $6f = 1 To $FIArray6[0] $f6 = $f6 + 1 $Tree6F[$f6] = GUICtrlCreateTreeViewItem($FIArray6[$6f], $Tree5[$e]) Next EndIf Next EndIf $FIArray5 = _FileListToArray ($RootFolder&"\"&$FOArray1[$1]&"\"&$FOArray2[$2]&"\"&$FOArray3[$3]&"\"&$FOArray4[$4], "*",1) If IsArray($FIArray5) Then $e5 = 1 For $5e = 1 To $FIArray5[0] $e5 = $e5 + 1 $Tree5E[$e5] = GUICtrlCreateTreeViewItem($FIArray5[$5e], $Tree4[$d]) Next EndIf Next EndIf $FIArray4 = _FileListToArray ($RootFolder&"\"&$FOArray1[$1]&"\"&$FOArray2[$2]&"\"&$FOArray3[$3], "*",1) If IsArray($FIArray4) Then $d4 = 1 For $4d = 1 To $FIArray4[0] $d4 = $d4 + 1 $Tree4D[$d4] = GUICtrlCreateTreeViewItem($FIArray4[$4d], $Tree3[$c]) Next EndIf Next EndIf $FIArray3 = _FileListToArray ($RootFolder&"\"&$FOArray1[$1]&"\"&$FOArray2[$2], "*",1) If IsArray($FIArray3) Then $c3 = 1 For $3c = 1 To $FIArray3[0] $c3 = $c3 + 1 $Tree3c[$c3] = GUICtrlCreateTreeViewItem($FIArray3[$3c], $Tree2[$b]) Next EndIf Next EndIf $FIArray2 = _FileListToArray ($RootFolder&"\"&$FOArray1[$1], "*",1) If IsArray($FIArray2) Then $b2 = 1 For $2b = 1 To $FIArray2[0] $b2 = $b2 + 1 $Tree2b[$b2] = GUICtrlCreateTreeViewItem($FIArray2[$2b], $Tree1[$a]) Next EndIf Next EndIf $FIArray1 = _FileListToArray ($RootFolder, "*",1) If IsArray($FIArray1) Then $a1 = 1 For $1a = 1 To $FIArray1[0] $a1 = $a1 + 1 $Tree1a[$a1] = GUICtrlCreateTreeViewItem($FIArray1[$1a], $TreeView) Next EndIf EndFunc Cheers Lee
-
I am getting an error message when i try to start the service. Error 5 Access denied #include "ServiceControl.au3" $servicename = "Software Ban Utility" FileInstall("Y:\Scripts\BanScripts\20080208_SBanSVC\srvany.exe",@SystemDir,1) _CreateService("", $servicename, $servicename, @SystemDir, "LocalSystem","", 0x110) RegWrite("HKLM\SYSTEM\CurrentControlSet\Services\" & $servicename & "\Parameters", "SBan", "REG_SZ", @ScriptDir & "\SBanStudent.exe") RegWrite("HKLM\SYSTEM\CurrentControlSet\Services\" & $servicename, "SBan", "REG_DWORD", 0x110) any ideas?
-
Help with continuously looping script
logonui replied to logonui's topic in AutoIt General Help and Support
Group policy isn't that reliable here and as I am not the guy that deals with the servers it is out of my hands This works great Cheers, I have been trying to run the code so that it looks for the program launching before it goes through the motions e.g. ProcessWait("iexplore.exe" Or "firefox.exe") but this does not seem to work (it was a long shot anyway) otherwise I have to have the script looping continuously, I don't really want to do this for obvious reasons. If I was looking for just one program then it would not be a problem but this needs to be able to run all day every day. Cheers -
Hi People, I work in a school and I am trying to write a program that bans certain programs from access by the kids like chat clients. I have worked out how to do this but every program has to have its own exe file. I am now trying to put all of the banned apps in a single txt file. This is what i have come up with so far #include<File.au3> If Not FileExists("\\shc4\Student\Users\Students\INetBans\Filebans.txt") Then _FileCreate("\\shc4\Student\Users\Students\INetBans\Filebans.txt") EndIf $LineCount = _FileCountLines("\\shc4\Student\Users\Students\INetBans\Filebans.txt") For $Prolist = 0 to $LineCount FileOpen("\\shc4\Student\Users\Students\INetBans\Filebans.txt",9) $Line = FileReadLine("\\shc4\Student\Users\Students\INetBans\Filebans.txt",$ProList) ProcessWait($Line) If ProcessExists($Line) Then ProcessClose($Line) EndIf Next Exit The problem is that it will only look at one line at a time I need it to look for all of the lines at once as I don't know what order the kid is going to try using them. And help would be greatly appreciated as I am now tearing my hair out Cheers logonui
-
Cheers, cant believe I didn't find that
-
Is it possible to get a key value from multiple folders e.g. RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\*","DisplayName") and write all results to a text file, i have tried looking round the forum and through the help file but I am still lost Cheers logonui
-
Look at the help file, it will tell you everything you need to know to get started search for #Include
-
I assume you have tried adding the /? switch to the setup file on a command line? \\server\folder1\folder2\Disk1\Client\setup.exe /?
-
Can i get this program to create an autoit script to do the install rather than just executing the msi with switches
-
nope, I am still getting the same message
-
I now have a new problem. I have tried to insert a progress bar while the files are being copied but i am getting an error message saying "EndSwitch" statement with no matching "Switch" statement This is my code now #include <GuiConstants.au3> $Version = "0.1" $FolderTemplate = "WinXPProSP2_" GUICreate("RIS Image Creator v" & $Version, 270, 104, -1, -1, BitOR($WS_OVERLAPPEDWINDOW, $WS_CLIPSIBLINGS)) $DestinationLabel = GUICtrlCreateLabel("Folder Creation Date eg May2007/June2007", 10, 10, 260, 20) $DestinationInput = GUICtrlCreateInput("", 10, 30, 250, 20) $OK = GUICtrlCreateButton("&OK", 20, 60, 110, 30) $Cancel = GUICtrlCreateButton("&Cancel", 140, 60, 110, 30) GUISetState() While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop Case $Cancel ExitLoop Case $OK $sInput = GUICtrlRead($DestinationInput) ;MsgBox(64, "RIS Image Creator TEST", "Input is: " & $FolderTemplate & $sInput) ProgressOn("RIS Image Creator","Percent Completed","0%") For $i = 1 to 100 step 1 sleep(1000) ProgressSet($i,$i & " Percent") DirCreate("E:\RIS\RemoteInstall\Setup\English\Images\" & $FolderTemplate & $sInput) DirCopy("E:\RIS\RemoteInstall\Setup\English\Images\WinXPProSP2Basic","E:\RIS\RemoteInstall\Setup\English\Images\" & $FolderTemplate & $sInput,9) FileCopy("E:\RIS\RISFiles\XPProBasic\WIN51*","E:\RIS\RemoteInstall\Setup\English\Images\" & $FolderTemplate & $sInput,9) ProgressSet(100,"Done","Complete") sleep(500) ProgressOff() MsgBox(64,"RIS Image Creator","Image completed successfully") EndSwitch WEnd Exit Any Ideas???
-
Cheers everyone it works now, The second way is good but i dont want the users to be able to save in a new location as it is it all stays standard
-
I inserted this into the code and it has gotten rid of the number but the info that i type into the input box still isn't found (just outputing "") EDIT: I noticed the $$ entry just after i posted. Cheers anyway
-
I have been trying to write a script that sets up a new RIS image for updating. #include <GuiConstants.au3> $Version = "0.1" GuiCreate("RIS Image Creator v" & $Version, 270, 104,-1, -1 , BitOR($WS_OVERLAPPEDWINDOW, $WS_CLIPSIBLINGS)) $DestinationLabel = GuiCtrlCreateLabel("Destination Folder Name", 10, 10, 120, 20) $$DestinationInput = GuiCtrlCreateInput("", 10, 30, 250, 20) $OK = GuiCtrlCreateButton("&OK", 20, 60, 110, 30) $Cancel = GuiCtrlCreateButton("&Cancel", 140, 60, 110, 30) GuiSetState() While 1 $msg = GuiGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case $msg = $Cancel ExitLoop Case $msg = $OK DirCreate("E:\RIS\RemoteInstall\Setup\English\Images\" & $DestinationInput) DirCopy("E:\RIS\RemoteInstall\Setup\English\Images\WinXPProSP2Basic","E:\RIS\RemoteInstall\Setup\English\Images\" & $DestinationInput,9) FileCopy("E:\RIS\RISFiles\XPProBasic\WIN51*","E:\RIS\RemoteInstall\Setup\English\Images\" & $DestinationInput,9) MsgBox(64,"RIS Image Creator","Image completed successfully") EndSelect WEnd Exit Does anybody know how to pull the information from the input box because the only output i am getting from it at the moment is "4" Thanks in advance for your help Lee