Jump to content

chaos945

Active Members
  • Posts

    32
  • Joined

  • Last visited

chaos945's Achievements

Seeker

Seeker (1/7)

0

Reputation

  1. That is pretty slick. Thanks. It took me a minute to wrap my brain around your script, below is an example INI.
  2. I had this idea today but I don't have time to make it. Perhaps someone with more time wants to try. I have a USB drive with lots of misc tools on it. Lots of them require constant updates. The idea is to create either a GUI based list, that can easily be added to. Inputting the URL of the location to check for updates, and the location of the current copy of the file on the USB drive. Comparing the file size difference between the two, then downloading the updated file if a size difference is detected. Alternatively one could skip the GUI and just run a simpler script, modifying the list using an INI. Here is an example of how one might approach the above idea. I created this script to update my portable copy of AntiVir because the build-in updater breaks if the program is not correctly installed. The script checks the URL for a difference in size, it utilizes IZARCE.exe to then extract the ZIP'd file. Also here are some misc URL's I've collected that I was considering to use with the tool.
  3. I could use some feed back on this little sequential execution script I've been working on. It uses a config.ini file (which is generated on first run) to launch applications sequentialy. I use it at the shop to run programs to prep systems for service. I am utilizing PsKill.exe for this script it must be installed in the script directory prior to running. To use the script: 1. Copy a program you use into the script directory (ie. copy entire "CCleaner folder") 2. Add the name of the executable to config.ini (ie. ccleaner.exe) 3. Run Script For example my config.ini looks like this: #RequireAdmin #include <File.au3> #include <Array.au3> #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #NoTrayIcon If @OSTYPE <> "WIN32_NT" Then MsgBox(4096, "Error", @OSVersion & " is not supported by this rollout. Only WIN32/NT versions of Windows are compatible.") Exit EndIf Opt("GUIOnEventMode", 1) ;BEGIN MAIN GUI $Form1 = GUICreate("Tech Tools Macro", 178, 66, 1136, 6, BitOR($WS_CAPTION,$WS_POPUP,$WS_POPUPWINDOW), $WS_EX_TOOLWINDOW+$WS_EX_TOPMOST) $Terminate = GUICtrlCreateButton("Terminate", 8, 8, 95, 49, 0) GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif") GUICtrlSetCursor (-1, 0) $Next = GUICtrlCreateButton("Next", 112, 8, 57, 49, 0) GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif") GUICtrlSetCursor (-1, 0) GUISetState(@SW_SHOW) ;END MAIN GUI ;AdlibEnable("GUIRefresh", 250);Allows GUI to refresh during a process and between processes GUISetOnEvent($GUI_EVENT_CLOSE, "Exit1") GUICtrlSetOnEvent($Terminate, "Terminate") GUICtrlSetOnEvent($Next, "Nextf") DIM $config ;BEGIN - File config.ini array and file search ;Read Config.ini to an array and Run Processes in sequence If NOT _FileReadToArray("Config.ini", $config) Then $genfile = FileOpen("Config.ini", 2) FileWrite("Config.ini", "[Processes]") FileClose($genfile) _FileReadToArray("Config.ini", $config) EndIf For $a = 2 to $config[0] $runcode = $a $nextf = 0 Do If $runcode = $a Then $search1 = _FileListToArray(@ScriptDir, "*", 1) $results = _ArraySearch($search1, $config[$a], 0, 0, 0, True);search @ScriptDir for file If @error = 6 Then;if it was not found then list the directories and array $search2 = _FileListToArray(@ScriptDir, "*", 2);search2 is a list of directories in @ScriptDir ;_ArrayDisplay($search2) For $b = 1 to $search2[0];check each directory for file; $search2[0] is the total number of directories $filelist = _FileListToArray($search2[$b], "*", 1);array files in directory $b ;_ArrayDisplay($filelist) ;MsgBox(0, "Process to launch", $config[$a]) $results = _ArraySearch($filelist, $config[$a], 0, 0, 0, True);search directory $b for file $a If @error = 6 Then $results = "not found" ElseIf $filelist[$results] = $config[$a] Then $runcode = Run(@Scriptdir & "\" & $search2[$b] & "\" & $config[$a]) ExitLoop EndIf Next If $results = "not found" Then If NOT $config[$a] = "" Then;ignores blank entries in config.ini MsgBox(0, "Tech Tools Macro", $config[$a] & " could not be found.", 10) EndIf ;ExitLoop 1 EndIf ElseIf $search1[$results] = $config[$a] Then $runcode = Run($config[$a], @Scriptdir) EndIf EndIf Sleep(250);performance Until NOT ProcessExists($runcode) OR $nextf = 1 Next GUISetState(@SW_HIDE) MsgBox(0, "Tech Tools Macro", "All processes complete!") Exit ;END Func Exit1() $choice1 = MsgBox(4, "Tech Tools Macro", "Are you sure you want to exit? All currently running processes will be terminated.") If $choice1 = 6 Then For $b = 2 to $config[0] Run("Pskill.exe " & ($config[$b]), @SCRIPTDIR, @SW_HIDE) Next Exit EndIf EndFunc Func Terminate() Run("Pskill.exe " & ($config[$a]), @SCRIPTDIR, @SW_HIDE) EndFunc Func Nextf() Global $nextf = 1 EndFunc
  4. Has anyone successfully done this? I am trying to launch an executable and track spawned child processes. Ie: A.exe launches B.exe and the PID is linked somehow to A.exe. For anyone with Spybot - S&D installed see for instance launch "SDMAIN.exe" this in turn launches "SPYBOTSD.exe". I could just run "SPYBOTSD.exe" but it is super-hidden by default and _FileListToArray() does not seem to find it.
  5. I don't know about your windows but on mine, XP Pro, all I can set in Services.msc is auto/manual/disable. And I can't even see boot or system services. I'd love to write this program but I don't have the time, just the time to post on fourms. A friend of mine wrote some test code, using beta. I'm still wanting to see: Description retrieval, a right-click or button to Start/Stop services, display options to show hide boot/system/normal services, a backup current services button, a undo current session (of changes) button (both of these would be nice in a menu), a presets selection to apply Start states to certain common services, and a create new service option. This is exactly what I was thinking. I hope it inspires some more thought on the matter. serviceadmin.au3 serviceadmin.rar
  6. While looking for an easy way to deploy predefined Service settings on Windows XP, I stumbled across a few interesting things in the registry. Firstly all service information is stored in: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services Most of us already know that by using Services.msc a service can be set to Automatic, Manual, or Disabled. But there are other service start values that I discovered such as Boot and System. After looking at my own services for a while I found this URL, which will give you an idea of what you would see if you looked into your own registry. Notice specifically the START type: Boot, System, and Automatic. I thought it was interesting how these services were not listed in Services.msc nor very well documented. So, here is the idea. Create a GUI tool that can read the registry for BOOT, SYSTEM, and normal visible services. Allow their "Start" value to be seen, the "DisplayName", the "Description", the "Group", and any other interesting keys. By doing this one could easily see and manage these services without pouring through the registry. I would also like to see a "recommended presets" option to easily allow preset "Start" values for common configurations to remove useless or harmful services. SC.exe could be integrated to uninstall services, see documentation by typing "sc /?" in command prompt. Example: [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\cbidf2k] "ErrorControl"=dword:00000001 ;I'm not sure about this, I didn't look into it, I assume it sets what to do if a service fails, may be interesting to include. "Group"="SCSI miniport" ;perhaps allow services with the same "Start" parameter to be arranged by "Group" so you can see what is all running in a group. "Start"=dword:00000004 "Tag"=dword:00000019 ;I'm not sure about this, I didn't look into it. Notice the URL uses this TAG information, could be interesting. "Type"=dword:00000001 ;I'm not sure about this, I didn't look into it. Could be ownership of service. Here is a list of the available "Start" parameters. Value = Startup Type 0 = boot 1 = system 2 = automatic 3 = manual 4 = disabled There are more values than these for some services but, just as a start, enumerating this information would be very interesting and useful in developing a more complex program later on.
  7. I rewrote this script as a function, currently it will only work on mass files of the same extension I don't have single file functionality programmed in yet. : : E x a m p l e : : #include <FileRename.au3> ; FileRename(iflag, "extension", "source", "destination") $ireturn = FileRename(0, "txt", "Example\Source\", "Example\Destination\") MsgBox(0, "Return", $ireturn) ;__________________________________________________________ ; F L A G S ; 0 = all files ; 1 = single file ;__________________________________________________________ ;__________________________________________________________ ; R E T U R N S ; 0 = incorrect $iflag ; 1 = invalid extension ; 2 = source folder/path does not exist ; 3 = destination folder/path does not exist ; 4 = no files found ; 5 = unable to get file info ; Success = No errors ; Unknown Error = Script finished but there was an error ;__________________________________________________________FileRename_Func.zip
  8. This is a simple script designed to fulfil a request. It was intented to work as an alternative way to back up certain types of files by date. It will: detect a specified file type, rename the file(s) to their creation date, then move them from a source directory to a destination directory. It can be used through a command line with the specified arguments only. Example Syntax: COMPILED: scriptname.exe <source> <destination> <filetype> RAW: autoit3.exe <script location\name.au3> <source> <destination> <filetype> timebch.zip
  9. Have you seen bots like these?
  10. I was trying to get this working too, the best I came up with was the attached below. Checkbox_ListView.au3
  11. mikew512: I like your checkbox idea. jmatt: That Wolfgang guy did a pretty good job. I've went through his design and am planning on adding a few things I liked in his version and a few of my own. As for the streams and contig I'm still reading... This new build its still just for show, I've not had alot of time, blah, blah. You can now defrag single drives only. Version 1.0.1.1 Added Since Last Build: - finished options >output> config.ini - added fancy image in about menu Next Build: - finish off all defragmentation actions, move by lcn, date, compact, defrag, etc - begin design of the scheduler I've been having trouble getting the ListView items to give a usable return for multiple selections. For instance selecting multiple drives and putting the drive information in either one array or two seperate ones. See line 258. DIRMS_GUI_0.1.1.1.zip
  12. Simple registry modification script. Thinking about using it as the basis for something more complicated. Adds "Enqueue in MPC" to all supported video files. MPC_Enqueuer.zip
  13. I've been thinking about that the past couple of days. I think maybe the easiest way will be start a timer with the first pass, so: $elapsed = TimerStart() dirms c: defrag $elapsed = TimerEnd($elapsed) Then we'd know how long it takes to complete a defrag pass on drive 'c'. A very loose guess could then be made based on: * the number of passes left * the types of passes * the percentage used space on each drive The further the process goes the more accurate it would be. After each pass completed the elapsed time estimate would refresh based on the new info, the time it took the previous pass to complete and what type of pass it was. I've been trying to figure out a way to benchmark the system by throwing various sized files from directory to directory and timing them, but I've had not very good luck with that. Any suggestions?
  14. Just so you know I didn't just forget about this project, I've got this prototype version for you to take a peek at. Nothing has been implemented as far as actual defragmenting goes but it soon will. Currently it will detect and display information about the drives on your computer. I'm planning a defrag all function and in the options the ability to set the number of passes used to defragment. ie. move by lcn, compact
  15. Version 0.2.0.4 New version many fixes, few bugs left. All the buttons work properly and I've added a "NEXT" button to force launching of the next line if you don't want to wait for the previous process to end. Also added a terminate button. To use DOS commands format like: @cmd [DOS COMMAND] Example: @cmd ipconfig /release all Minor updates, mostly gui/interface. 59 Downloads before updating. Batch_Creator.zip
×
×
  • Create New...