 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
TheLostBoy
Joined: 18 Apr 2005 Posts: 14 Location: WI, USA
|
Posted: Tue May 24, 2005 6:59 pm Post subject: Auditing File List's |
|
|
| Code: | Gui, Add, Button, x106 y70 w80 h20, Audit! ; button1
Gui, Add, Checkbox, x6 y70 w90 h20, Full System ; button2
Gui, Add, Checkbox, x6 y40 w90 h20, Program Files ; button3
Gui, Add, Checkbox, x6 y10 w90 h20, Current User ; button4
Gui, Add, Checkbox, x106 y40 w80 h20, Hidden Audit ; button5
Gui, Add, Text, x106 y13 w80 h14, RushAudit! v1.0
Gui, Show, x466 y253 h98 w195, RushAudit! v1.0
Return
GuiClose:
ExitApp |
Yup I got about that far and figured out that I have a few reasons I'm not a gui person..
1. I get all scrambled and confused reading the help file under the gui section
2. The above took me 3ish hours to get (I now understand the usefulness of the smart gui creator)
SO...
what I'm trying to do is create a program that will audit (for lack of a nicer word) the files in
1. the current user
2. the program files
3. a full system listing
I have created the script for the full system audit already..
| Code: | IfExist, RushAudit Log.txt
{
FileDelete, RushAudit Log.txt
}
FileAppend, User Info`n, RushAudit Log.txt
FileAppend, ---------`n, RushAudit Log.txt
FileAppend, Computer: %A_ComputerName%`n, RushAudit Log.txt
FileAppend, User Account: %A_UserName%`n, RushAudit Log.txt
FileAppend, Operating System: %A_OSVersion%`n, RushAudit Log.txt
FileAppend, Screen Width: %A_ScreenWidth%`n, RushAudit Log.txt
FileAppend, Screen Height: %A_ScreenHeight%`n, RushAudit Log.txt
FileAppend, Time of Gathering: %A_hour%:%A_Min%:%A_sec%`n, RushAudit Log.txt
FileAppend, Date of Gathering: %A_MM%/%A_DD%/%A_YYYY%`n, RushAudit Log.txt
FileAppend, `n`nFile Listing`n------------`n, RushAudit Log.txt ; Separates the Current User Info from the Upcoming Files
SplashTextOn, 400, 180, Getting Names!..., ThisTextShouldn'tBeHERE!!!
Loop, %C%\*.*, 1, 1
{
ControlSetText, , %a_loopfilelongpath%, Getting Names!...
FileAppend, %a_index%: %a_loopfilelongpath%`n, RushAudit Log.txt
}
FileAppend, `nFinal Time of Gathering: %A_hour%:%A_Min%:%A_sec%`n, RushAudit Log.txt |
(That took me about 15min plus a soda run and smoke break )
and that works gr8 if I put it in its own file with the splashtexton but, the problem with that is that it is displaying all the filenames and it took 18.9 minutes to gather the filenames of 37700 files.
Basically here's what I'm looking to do.
1. Getting the "Audit!" (i.e. OK) button working
2. Getting the script to recognize what checks are checked
i. Plus if the "Full System" one is checked I want it to uncheck the other two if they are checked
3. I can get the "Hidden Audit" to work I THINK!!
i. Gui, Hide ; Is that right?
4. Creating subroutiens for the different checkboxes
5. Speed it up somehow (200 names/sec would be awsome LOL)
Sorry for such a long and mixed up post.. this is my absolute VERY first GUI I'm making, well, trying to make with AHK.. if there's need for clarification just ask and perhaps by then my brain will have gotten rid of its charlie-horse  _________________ "It was when I found out I could make mistakes that I knew I was on to something."
--Ornette Coleman |
|
| Back to top |
|
 |
Chris Site Admin
Joined: 02 Mar 2004 Posts: 10716
|
Posted: Wed May 25, 2005 9:55 pm Post subject: Re: Auditing File List's |
|
|
| TheLostBoy wrote: | | 1. Getting the "Audit!" (i.e. OK) button working | You might already know that when the user presses a button, that button's subroutine is launched. If you don't assign particular g-label to the button, by default "ButtonAudit!" will be used:
ButtonAudit!:
MsgBox You pressed the button.
return
| Quote: | 2. Getting the script to recognize what checks are checked
i. Plus if the "Full System" one is checked I want it to uncheck the other two if they are checked | Generally, each checkbox should have an associated variable. You can do this by including the letter v followed by the variable name in each checkbox's options. For example:
Gui, Add, Checkbox, vCheckProgramFiles x6 y40 w90 h20, Program Files ; button3
Then later, when you do a "Gui Submit", the variable CheckProgramFiles will contain 1 if the box was checked or 0 if not. You can also use GuiControlGet to fetch a checkbox individually:
| Code: | ButtonAudit!:
GuiControlGet, CheckProgramFiles
if CheckProgramFiles
MsgBox The Program Files checkbox is checked.
else ; It's zero.
MsgBox The Program Files checkbox is not checked.
return |
| Quote: | 3. I can get the "Hidden Audit" to work I THINK!!
i. Gui, Hide ; Is that right? | Yes, that would hide the window.
| Quote: | | 4. Creating subroutiens for the different checkboxes | You need a subroutine only if you want some action to occur the instant the user clicks the box.
| Quote: | | 5. Speed it up somehow (200 names/sec would be awsome LOL) | ControlSetText has a delay after each usage. You can do SetControlDelay -1 at the top of the script to eliminate the delay. You can also add SetBatchLines -1 at the top of the script to have it run faster. |
|
| Back to top |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|