
RBrown1375
Active Members-
Posts
60 -
Joined
-
Last visited
About RBrown1375
- Birthday 04/09/1957
Profile Information
-
Location
Seattle
RBrown1375's Achievements

Wayfarer (2/7)
0
Reputation
-
Thank You very much!! I see what I did wrong. Have a great day!!
-
right now I feel like such a newbie. I can't get this code to work and I have now botched it so bad I need another set of eyes please. All I'm trying to do is build a small GUI app that will allow a user to enter the path and file type and the app will recurse through the folders and return all the files of that type. I have this close to working but I'm lost on the search functions. Any would be great. I did look over the examples before asking for help. Thanks #include <Array.au3> ; Only required to display the arrays #include <File.au3> #include <MsgBoxConstants.au3> #include <MsgBoxConstants.au3> #include <GUIConstants.au3> #RequireAdmin Example() Func Example() ; Places the input box in the top left corner displaying the characters as they ; are typed. Local $sValue1 = InputBox("File Search", "What File Extension Are You Looking For?", "", "", _ -1, -1, -1, 0) Local $sValue2 = InputBox("File Search", "Enter The File Path?", "", "", _ -1, -1, -1, 0) ; Display the result. MsgBox($MB_SYSTEMMODAL, "", $sValue2 & $sValue1) Local $sValue1 = StringLeft($sValue1, StringInStr($sValue1, "", Default, -1)) If StringRight($sValue2, 5) = "beta\" Then $sValue2 = StringTrimRight($sValue2, 5) EndIf ConsoleWrite($sValue2 & @CRLF) ; A sorted list of all files and folders in the Userdata1 Location Local $aArray = _FileListToArrayRec($sValue2 ,$FLTAR_FILESFOLDERS, $FLTAR_RECUR, $FLTAR_SORT) _ArrayDisplay($aArray, "Sorted tree") ; And now ignoring the "Include" folder ; $aArray = _FileListToArrayRec($sMusicFind, "*||include", $FLTAR_FILESFOLDERS, $FLTAR_RECUR, $FLTAR_SORT) ; _ArrayDisplay($aArray, "No 'Include' folder") ; A sorted list of all but the .exe files in the \AutoIt3 folder ; $aArray = _FileListToArrayRec($sMusicFind, "*|*.exe", $FLTAR_FILES, $FLTAR_NORECUR, $FLTAR_SORT) ; _ArrayDisplay($aArray, "Non .EXE files") ; And here are the .exe files we left out last time ; $aArray = _FileListToArrayRec($sMusicFind, "*.exe", $FLTAR_FILES) ; _ArrayDisplay($aArray, ".EXE Files") ; A test for all folders and .exe files only throughout the folder tree, omitting folders beginning with I (Icons and Include) ; $aArray = _FileListToArrayRec($sMusicFind, "*.exe||i*", $FLTAR_FILESFOLDERS, $FLTAR_RECUR, $FLTAR_SORT) ; _ArrayDisplay($aArray, "Recur with filter") ; Look for icon files - but exlude the "Icons" folder ; $aArray = _FileListToArrayRec($sMusicFind, "*.ico||ic*", $FLTAR_FILES, $FLTAR_RECUR, $FLTAR_SORT) If @error Then MsgBox($MB_SYSTEMMODAL, "Ooops!", "No ico files found") Else _ArrayDisplay($aArray, "Icon files not in 'Icons' folder") EndIf ; And to show that the filter applies to files AND folders when not recursive ; $aArray = _FileListToArrayRec($sValue1, "*.mp3", $FLTAR_FILESFOLDERS, $FLTAR_NORECUR, $FLTAR_SORT) ; _ArrayDisplay($aArray, "Non-recur with filter") ; The filter also applies to folders when recursively searching for folders ; $aArray = _FileListToArrayRec($sMusicFind, "Icons", $FLTAR_FOLDERS, $FLTAR_RECUR, $FLTAR_SORT) ; _ArrayDisplay($aArray, "Folder recur with filter") ; Note the exlude_folder parameter is ignored when looking for folders - "Icons" will be excluded but "Include" will still be there ; $aArray = _FileListToArrayRec($sMusicFind, "*|ic*|i*", $FLTAR_FOLDERS, $FLTAR_RECUR, $FLTAR_SORT) ; _ArrayDisplay($aArray, "'Icons' out - 'Include' in") ; The root of C:\Windows showing hidden/system folders ; $aArray = _FileListToArrayRec("C:\Windows\", "*", $FLTAR_FOLDERS) ; _ArrayDisplay($aArray, "Show hidden folders") ; The root of C:\Windows omitting hidden/system folders ; $aArray = _FileListToArrayRec("C:\Windows\", "*", $FLTAR_FOLDERS + $FLTAR_NOHIDDEN + $FLTAR_NOSYSTEM) ; _ArrayDisplay($aArray, "Hide hidden folders") EndFunc ;==>Example
-
RBrown1375 reacted to a post in a topic: Locate File Types
-
RBrown1375 reacted to a post in a topic: Locate File Types
-
Thank You both for your replies. I will check both out. Cheers
-
Problem: Users are saving music and video files on my servers and it is taking up too much space. The company allows them to save some, but not this much. Solution: I'm trying to write an AutoIT script that can look at all files and folders on a drive and return the folder name and number of file types: .avi, .mp3 and so on. It would be helpful if this script to save the results to a log file so the IT team can send emails to the users or managers asking them to remove the files. If you know if a template or script that is close to my needs please let me know. Thank You
-
I have a customer asking to have MP3 and MP4 files removed from their server and I have a recursive script that works fine, but they want it to do the following: Search for MP3 and MP4 files on the server, but only on fixed drives, no network connections. Delete all the files it sees except from folders they say it's ok to have the files: Keep contents: folder name, folder name, folder name Delete contents :All other folders There is a bunch of other crap, but I think I can solve those from some of your examples and other AutoIT scripts I have if I can get this to work. I just need a solid starting point. Thank You in Advance.
-
I looked through the Forums and didn't see if someone had a sample script for this problem. I have a folder E: Public, with a Task Scheduled to clear out the folder everyday at 07:00 and move the contents of the folder to E:TempPublicArchive. Is there a way to build a script that looks at the date or time and if the filefolder has not been in E:Public for at least 24 hours, it will leave the filefolder alone. Anything over that time, will be moved to the Archive folder. Thank you for any ideas you may have.
-
I'm using SciTE Ver. 3.2.0 to write my scripts and I wrote a few scripts that worked great, but during some testing of another software, my AutoIT folder was deleted and I lost all my .Au3 scripts for the last two years and need to covert my Exe's back to Au3. I have looked everywhere and can find it, so I guess I really didn't look everywhere if you know where it is. Does anyone know where I can get this tool so I can start over? Thank You
-
Nessie, Your script additions worked great. Thank you!!!! Cheers
-
Thank You for the response. I'll work on this now and let you know.
-
Sorry I did leave that out. This will target x86 systems only Win 7 and XP. I'll try your error code.
-
Thank you for responding, I have hit a wall and it seems so simple, but I just can't get it. I have to run a Java update. The script needs to look in the registry, see version 7.x and then do something. If the RegRead returns a value of 1.7.0_15 then stop. If RegRead returns any other version 7, then continue on and run the install. Everything else in my code is working fine, except being able to identify the product code and do the next thing: Close or install. Here is part of my code: #RequireAdmin Local $a = "C:\Windows\Temp\" Dim $var2 = "1.7.0_15" Local $b = "C:\Users\" Local $Sun = "C:\Users\" & @UserName & "\AppData\LocalLow\Sun\Java\Deployment\" Local $Sun2 = "C:\Users\" & @UserName & "\AppData\LocalLow\Sun\Java\Deployment\security\" Local $Sun3 = "C:\Users\" & @UserName & "\AppData\LocalLow\Sun\Java\Deployment\tmp\si" ;File copy section: Each Application is taken from the source and copied to the folders created ;If $a = True Then FileInstall("E:\JAVA\JRE7_15\jre-7u15-windows-i586.exe", "C:\Windows\Temp\jre-7u15-windows-i586.exe") ;Sleep(5000) ;Registry lookup for Java installation Local $var = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Runtime Environment\", "Java7FamilyVersion") Sleep(5000) If $var = $var2 Then MsgBox(4096, "I see It:", $var) EndIf Else If Not $var2 = $var Then MsgBox(4096, "It Ain't Here:", $var) RunWait(@WindowsDir & "\Temp\jre-7u15-windows-i586.exe /s") Sleep(10000) ;MsgBox(4096, "I see It:", $var) EndIf everything below this works fine and the install file works fine as well. I placed message boxes in the code so I could track the code and they will be removed later. Any ideas would be great. Cheers
-
7zip script using Run/RunWait does not work
RBrown1375 replied to sundar's topic in AutoIt General Help and Support
Thank you for responding but all I get is a command prompt flash and nothing happens. Here is my code and I have alot rem'd out so I can test this faster. ;Commands for the progress bar and menu #include <WindowsConstants.au3> #include <StaticConstants.au3> #include <SendMessage.au3> ;Needed for _SendMessage function. #include <ProgressConstants.au3> ;Folder locations for each product to be copied too before running the application. Local $sFldr32 = "C:Program Files (x86)SymantecSymantec Endpoint Protection" Local $sFldr64 = "C:WindowsSysWOW64" Local $sFldrSep = "C:WindowsTempSep" Local $sSep32 = "C:WindowsTempSep32bit" Local $sSep64 = "C:WindowsTempSep64bit" Local $7z_File = "C:WindowsTempSEPDesktopx32.zip" Local $7z_Folder = "C:WindowsTempSEP32bit" Local $7z_7zip = "C:Program Files7zip" ;Folder creations for each product to install from ;File copy section: Each Application is taken from the source and copied to the folders created ;Local $a = True ;If $sSep32 = True Then FileInstall("I:SEPDesktopx32.zip", "C:WindowsTempSEP32bitDesktopx32.zip") ;Local $b = True ;If $sSep64 = True Then FileInstall("I:SEPDesktopx64.zip", "C:WindowsTempSEP64bitDesktopx64.zip") ;If $sSep32 = True Then FileInstall("I:SEPInstall.bat", "C:WindowsTempSEP32bitInstall.bat") #cs ;SplashScreen while SEPTool runs $hProgressSplash = _SplashTextProgress("Please Wait. This Window Will Close Automatically.") Func _SplashTextProgress($sText) ;Creates a Splash Text Screen with a progress bar. SplashOff() ;Turn previous splash text screens off. $hSplash = GUICreate("", 500, 400, -1, -1, BitOR($WS_POPUP, $WS_BORDER), BitOR($WS_EX_TOPMOST, $WS_EX_WINDOWEDGE, $WS_EX_TOOLWINDOW)) ;~ $iProgressBar = GUICtrlCreateProgress(100, 325, 305, 25, $PBS_SMOOTH) $iProgressBar = GUICtrlCreateProgress(100, 325, 305, 25, $PBS_MARQUEE) ;A Marquee progress bar. _SendMessage(GUICtrlGetHandle(-1), $PBM_SETMARQUEE, True, 80) ;last parameter is update time in ms. Sends message to run the Marquee progress bar. $iMessage = GUICtrlCreateLabel($sText, 0, 100, 500, 200, $SS_CENTER) GUICtrlSetFont(-1, 16, 400, 0, "Courier New") GUISetState(@SW_SHOW) Return SetExtended($iProgressBar, $hSplash) EndFunc ;==>_SplashTextProgress #CE ;Sleep(5000) ;If FileExists("C:WindowsSysWOW64CMD.exe") Then Run('C:Program files7zip7z x "' & $7z_File &' -y > nul -o"'& $7z_Folder & '"') ; Sleep(20000) ;Else ;Run("C:Program files7zip7z" x "C:WindowsTempSEP32bitDesktopx32.zip" -y > nul -o"C:WindowsTempSEP32bit") ; Sleep(20000) ; EndIf #cs If FileExists("C:WindowsSysWOW64CMD.exe") Then Run("C:WindowsTempSep64bitSep64.msi /qb /l*v REBOOT=ReallySuppress IDCENABLE=0") Else Run("C:WindowsTempSep32bitSep.msi /qb /l*v REBOOT=ReallySuppress IDCENABLE=0") Sleep(10000) EndIf #ce I retested the command line I sent in my last post and it worked fine in a Command Prompt window. Thanks