
trashy
Active Members-
Posts
117 -
Joined
-
Last visited
Recent Profile Visitors
493 profile views
trashy's Achievements
-
Using FileSelectFolder to set directory to save multiple files. Is it possible to view not select files and not just folders. This isn't really a solution but it is a nice easy little work around, a little insurance. You could easily compare files to existing but that's more than I needed for this situation #include <File.au3> #include <WindowsConstants.au3> #include <GUIConstantsEx.au3> Global $SaveTex = FileSelectFolder("SaveFiles", @ScriptDir) _Example() Func _Example() If @error Then Return Else $FileList = _FileListToArray($SaveTex, '*.*', 1) ;Add your file extension *.txt If $FileList = "0" Then ;Add your function here Else $ListGui = GUICreate("Contents", 200, 200, -1, -1, -1, $WS_EX_ACCEPTFILES) $Butt1 = GUICtrlCreateButton("yes", 5, 170, 65, 25) $Butt2 = GUICtrlCreateButton("no", 130, 170, 65, 25) GUICtrlCreateLabel("Selected Folder Containes these files", 10, 5, 250, 24) GUICtrlCreateLabel("Files will be Updated/Over Written", 10, 120, 250, 24) GUICtrlCreateLabel("Do You Wish to Continue", 10, 140, 250, 24) $lstmain = GUICtrlCreateList("", 0, 20, 200, 100) For $n = 1 To UBound($FileList) - 1 $File_Name = $FileList[$n] GUICtrlSetData($lstmain, $File_Name) Next GUISetState() While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE, $Butt2 GUIDelete($ListGui) Return Case $Butt1 ;Add Your Function Here GUIDelete($ListGui) Return EndSwitch WEnd EndIf EndIf EndFunc
-
I was thinking use ShellExecute and open folder in explorer to view content before saving, or _FileListToArrayRec and view in a listbox. @Subz that would be another easy work around @ Melba23 I looked at it briefly already, it has a lot of features to consider, I need to spend more time with it. I was hoping for something I was already familiar with. Ran into this before and it's not that big of a deal it would just be nice to view all folder content in FileSelectFolder dialog window. Phone keeps ringing I can't even finish a simple reply.
-
I need any and all files to be displayed in FileSelectFolder window. Some of the files I'm adding, saving to this folder are new some are intended to over write existing files. If files are visible in FileSelectFolder it will help users decide if they have the correct folder.
-
I am using FileSelectFolder to select a folder and save multiple files to it. Is there an easy way to display All content, Files and folders. I don't need to select a file I just need users to see folder content before saving.
-
I wasn't sure if my logic was sound but I was headed in the right direction and getting close. I would have never figured it out on my own, thanks again everyone. This will turn into a nice little driver backup program
-
trashy reacted to a post in a topic: Array diff 2d Array
-
@Chimp Thank You I see the little tweaks and how you used the true and false, maybe I learned something. Could be dangerous! Your example put me well on the way. #include <Array.au3> #include <File.au3> #include <GuiListView.au3> #include <GUIConstantsEx.au3> $DSTPATH = @HomeDrive & "\DriverBackup" $SRCPATH = @HomeDrive & "\Windows\inf" $SRC_PATH = @HomeDrive & "\Windows\System32\DriverStore\FileRepository" Local $hSRCFILEPATH = $SRCPATH, $hDSTFILEPATH = $DSTPATH, $aSRCDISKFILE Local $aSRCFILEPATH = _FileListToArrayRec($hSRCFILEPATH, "oem*.inf", 1, -10, 1, 1) Local $xArray[UBound($aSRCFILEPATH)][6] For $i = 1 To $aSRCFILEPATH[0] $xArray[$i][0] = $hSRCFILEPATH & '\' & $aSRCFILEPATH[$i] $xArray[$i][1] = $hSRCFILEPATH & '\' & StringLeft($aSRCFILEPATH[$i], StringInStr($aSRCFILEPATH[$i], '\', 0, -1) - 1) $xArray[$i][2] = IniRead($xArray[$i][0], 'Version', 'ClassGUID', 'Unknown') $xArray[$i][3] = IniRead($xArray[$i][0], 'Version', 'DriverVer', 'Unknown') $xArray[$i][4] = IniRead($xArray[$i][0], 'Version', 'Class', 'Misc') $xArray[$i][5] = IniRead($xArray[$i][0], 'Version', 'Provider', 'Unknown_Provider') If StringInStr($xArray[$i][5], "%") Then $test3 = StringRegExpReplace($xArray[$i][5], "%", "") $test4 = IniRead($xArray[$i][0], 'Strings', $test3, 'Misc') $xArray[$i][5] = $test4 EndIf Global $xArray Next Local $hSRC_FILEPATH = $SRC_PATH, $hDST_FILEPATH = $DSTPATH, $aSRC_DISKFILE Local $aSRC_FILEPATH = _FileListToArrayRec($hSRC_FILEPATH, "*.inf", 1, -10, 1, 1) Local $yArray[UBound($aSRC_FILEPATH)][6] For $i = 1 To $aSRC_FILEPATH[0] $yArray[$i][0] = $hSRC_FILEPATH & '\' & $aSRC_FILEPATH[$i] $yArray[$i][1] = $hSRC_FILEPATH & '\' & StringLeft($aSRC_FILEPATH[$i], StringInStr($aSRC_FILEPATH[$i], '\', 0, -1) - 1) $yArray[$i][2] = IniRead($yArray[$i][0], 'Version', 'ClassGUID', 'Unknown') $yArray[$i][3] = IniRead($yArray[$i][0], 'Version', 'DriverVer', 'Unknown') $yArray[$i][4] = IniRead($yArray[$i][0], 'Version', 'Class', 'Misc') $yArray[$i][5] = IniRead($yArray[$i][0], 'Version', 'Provider', 'Unknown_Provider') If StringInStr($yArray[$i][5], "%") Then $test3 = StringRegExpReplace($yArray[$i][5], "%", "") $test4 = IniRead($yArray[$i][0], 'Strings', $test3, 'Misc') $yArray[$i][5] = $test4 EndIf Global $yArray Next _ArrayDisplay($xArray, 'Array 1', '', 0, Default, 'Source inf|Source Path|GUID|DriverVer|Class|Providr') _ArrayDisplay($yArray, 'Array 2', '', 0, Default, 'Source inf|Source Path|GUID|DriverVer|Class|Providr') Local $bFound For $a = UBound($yArray) - 1 To 0 Step -1 $bFound = False For $b = 0 To UBound($xArray) - 1 If $yArray[$a][2] = $xArray[$b][2] Then $bFound = True ExitLoop EndIf Next If Not $bFound Then _ArrayDelete($yArray, $a) Next _ArrayDisplay($yArray, 'Array 2', '', 0, Default, 'Source inf|Source Path|GUID|DriverVer|Class|Providr') Local $bFound For $a = UBound($yArray) - 1 To 0 Step -1 $bFound = False For $b = 0 To UBound($xArray) - 1 If $yArray[$a][5] = $xArray[$b][5] Then $bFound = True ExitLoop EndIf Next If Not $bFound Then _ArrayDelete($yArray, $a) Next _ArrayDisplay($yArray, 'Array 2', '', 0, Default, 'Source inf|Source Path|GUID|DriverVer|Class|Providr') Local $bFound For $a = UBound($yArray) - 1 To 0 Step -1 $bFound = False For $b = 0 To UBound($xArray) - 1 If $yArray[$a][3] = $xArray[$b][3] Then $bFound = True ExitLoop EndIf Next If Not $bFound Then _ArrayDelete($yArray, $a) Next _ArrayDisplay($yArray, 'Array 2', '', 0, Default, 'Source inf|Source Path|GUID|DriverVer|Class|Providr')
-
@rootx Studied that example a couple times not quite comprehending it yet.
-
I found a couple examples I think you are dealing with 1 dimensional arrays. What I posted wasn't the real deal my arrays are 10 columns everything from file paths to driver arch. I think that's my problem is the multi dimension array. New to Arrays don't really understand it yet. Don't know what I'm doing half the time any ways. I'm afraid this may be beyond my comprehension for now. Workaround read .cat from oem*.inf and search driverstore for dir containing cat file. I'm trying to export 3rd party drivers from windows driver store.
-
Array 1 search source Windows\inf for all oem driver inf files Array 2 search source Windows\System32\DriverStore\FileRepository Goal is to use GUID from Array 1 to find matching Driver files in Array 2 and remove everything else I tried using StringInStr searching all ini files in FileRepository for GUID from array 1 So far that's a Bust! Could I not compare the 2 Arrays and remove everything from array 2 that doesn't match GUID of Array 1. I really don't know how to approach this, what's the easiest way to accomplish my goal. Don't think gonna figure this one out on my own. #include <Array.au3> #include <File.au3> #include <GuiListView.au3> #include <GUIConstantsEx.au3> $DSTPATH = @HomeDrive & "\DriverBackup" $SRCPATH = @HomeDrive & "\Windows\inf" $SRC_PATH = @HomeDrive & "\Windows\System32\DriverStore\FileRepository" Local $hSRCFILEPATH = $SRCPATH, $hDSTFILEPATH = $DSTPATH, $aSRCDISKFILE Local $aSRCFILEPATH = _FileListToArrayRec($hSRCFILEPATH, "oem*.inf", 1, -10, 1, 1) Local $xArray[UBound($aSRCFILEPATH)][4] For $i = 1 To $aSRCFILEPATH[0] $xArray[$i][0] = $hSRCFILEPATH & '\' & $aSRCFILEPATH[$i] $xArray[$i][1] = $hSRCFILEPATH & '\' & StringLeft($aSRCFILEPATH[$i], StringInStr($aSRCFILEPATH[$i], '\', 0, -1) - 1) $xArray[$i][2] = IniRead($xArray[$i][0], 'Version', 'ClassGUID', 'Unknown') $xArray[$i][3] = IniRead($xArray[$i][0], 'Version', 'DriverVer', 'Unknown') Global $xArray Next Local $hSRC_FILEPATH = $SRC_PATH, $hDST_FILEPATH = $DSTPATH, $aSRC_DISKFILE Local $aSRC_FILEPATH = _FileListToArrayRec($hSRC_FILEPATH, "*.inf", 1, -10, 1, 1) Local $yArray[UBound($aSRC_FILEPATH)][4] For $i = 1 To $aSRC_FILEPATH[0] $yArray[$i][0] = $hSRC_FILEPATH & '\' & $aSRC_FILEPATH[$i] $yArray[$i][1] = $hSRC_FILEPATH & '\' & StringLeft($aSRC_FILEPATH[$i], StringInStr($aSRC_FILEPATH[$i], '\', 0, -1) - 1) $yArray[$i][2] = IniRead($yArray[$i][0], 'Version', 'ClassGUID', 'Unknown') $yArray[$i][3] = IniRead($yArray[$i][0], 'Version', 'DriverVer', 'Unknown') Global $yArray Next _ArrayDisplay($xArray, 'Array 1', '', 0, Default, 'Source inf|Source Path|GUID|DriverVer') _ArrayDisplay($yArray, 'Array 2', '', 0, Default, 'Source inf|Source Path|GUID|DriverVer') For $a = UBound($yArray) - 1 To 0 Step -1 For $b = 0 To UBound($xArray) - 1 If Not $yArray[$a] = $xArray[$b] Then _ArrayDelete($yArray, $a) ExitLoop EndIf Next Next _ArrayDisplay($yArray, 'Array 2', '', 0, Default, 'Source inf|Source Path|GUID|DriverVer')
-
My goal was to find a tag file at the root of any drive. Using the array the way I was I would get the dreaded Please insert disk popup on empty floppy or card reader etc... It was driving me nuts it wasn't a major problem but I wasn't satisfied. For me to say this is nuts I had to think keep it simple dumb it down a little and finally!!!!!!!! I think this really is simple sweet #include <AutoItConstants.au3> #include <MsgBoxConstants.au3> #include <Array.au3> #include <File.au3> Global $aArray = DriveGetDrive($DT_ALL) Global $tagfile = "\My_Drivers.ini";<<<<<<<<<<<<Here's your tag file If @error Then ; An error occurred when retrieving the drives. MsgBox($MB_SYSTEMMODAL, "", "It appears an error occurred.") EndIf Global $aFILEINFO[UBound($aArray)][4] For $i = 1 To $aArray[0] $aFILEINFO[$i][0] = StringUpper($aArray[$i]) $aFILEINFO[$i][1] = DriveStatus($aFILEINFO[$i][0]) If $aFILEINFO[$i][1] = "READY" Then $bArray = FileFindFirstFile($aFILEINFO[$i][0] & $tagfile) If $bArray = "-1" Then $bArray = "" Else $bArray = $tagfile EndIf $aFILEINFO[$i][2] = $bArray $aFILEINFO[$i][3] = $aFILEINFO[$i][0] & $bArray EndIf Next _ArraySwap($aFILEINFO, 0, 1, True) _ArrayDisplay($aFILEINFO, '', '', 0, Default, '')
-
Tried DriveGetDrive("REMOVABLE") and also tried DriveGetDrive("FIXED") Separately they work with no annoying please insert disk(I'll tell you what to insert) I see no way to combine the two types, one or the other or all?
-
Using My_Drivers.ini (can be located root of any fixed, usb or cd drive)as a tag file to locate and set the drive as well as reading the info. Everything seemed to be working fine till I tried on a machine with an empty floppy and a couple empty sd card readers. Started getting error no disk please insert disk or something similar. It's not crashing just excessive error popups. I tried replacing the second error check with a DriveStatus check but failed miserably. I'm fairly new to arrays but usually I stick to it long enough I can find a solution. This time I'm lost, been trying a couple days on and off and no success. Everything I tried to modify or remove failed If @error Then ContinueLoop EndIf Please Help! Global $Profile = IniRead('X:\ProgramData\DEI_PE\Profile.ini', 'MyProfile', 'Profile', 'Unknown') Get_Drive() Func Get_Drive() Local $aArray, $aDrives = DriveGetDrive("ALL") If @error = 0 Then For $i = 1 To $aDrives[0] $aArray = _FileListToArrayRec($aDrives[$i] & "", "My_Drivers.ini", 1, -1, 1, 2) If @error Then ContinueLoop EndIf For $j = 1 To $aArray[0] ;_ArrayDisplay($aArray, '', '', 0, Default, '') $tString = StringSplit($aArray[1], "\") _ArrayAdd($aArray, $tString) _ArrayDelete($aArray, 4) _ArrayDelete($aArray, 2) _ArrayDelete($aArray, 0) ;_ArrayDisplay($aArray, '', '', 0, Default, '') Next Global $Array = ($aArray[0]) If IniRead($aArray[0], 'Load_at_boot', 'Auto_Load', 'Off') = "Off" Then Global $Auto = "Off" ElseIf IniRead($aArray[0], 'Load_at_boot', 'Auto_Load', 'Off') = "On" Then Global $Auto = "On" EndIf Global $MyDevices = $aArray[1] & "\My_Drivers\My_Devices\" & $Profile Global $MyProfile = $Profile Next EndIf EndFunc ;==>Get_Drive This is just a snippet from the entire code but everything relies on the location and info store by ini file. Need to search all fixed, usb and cd drives
-
Thanks everyone Just finished updating the installer I made with Autoit ( got a few people testing the new program layout ). Updated program Easy_DISM and created new app EZ Download DISM 10 to download and install Dism 10. Installer #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("Install Easy_DISM", 305, 163, 269, 126) $Button1 = GUICtrlCreateButton("Install", 48, 72, 80, 25) $Button2 = GUICtrlCreateButton("Cancel", 176, 72, 80, 25) $Label1 = GUICtrlCreateLabel("Create Shortcuts", 112, 8, 83, 17) $Checkbox1 = GUICtrlCreateCheckbox("DeskTop", 56, 32, 65, 17) GUICtrlSetState(-1, $GUI_CHECKED) $Checkbox2 = GUICtrlCreateCheckbox("StartMenu", 184, 32, 65, 17) GUICtrlSetState(-1, $GUI_DISABLE) $Label2 = GUICtrlCreateLabel("After Install you may be prompted to install DISM 10 ", 32, 112, 249, 17) $Label3 = GUICtrlCreateLabel("Windows 7 REQUIRED Windows 8.1 RECOMMEND", 24, 136, 262, 17) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE, $Button2 Exit Case $Button1 If FileExists(@ProgramFilesDir & "\Easy_DISM") Then DirRemove(@ProgramFilesDir & "\Easy_DISM", 1) EndIf If Not FileExists(@ProgramFilesDir & "\Easy_DISM") Then DirCreate(@ProgramFilesDir & "\Easy_DISM") EndIf If FileExists(@HomeDrive & "\ProgramData\EZDISM\7z.exe") Then FileDelete(@HomeDrive & "\ProgramData\EZDISM\7z.exe") EndIf If FileExists(@HomeDrive & "\ProgramData\EZDISM\7z.dll") Then FileDelete(@HomeDrive & "\ProgramData\EZDISM\7z.dll") EndIf If FileExists(@HomeDrive & "\ProgramData\EZDISM\EZ_config.ini") Then FileDelete(@HomeDrive & "\ProgramData\EZDISM\EZ_config.ini") EndIf If FileExists(@HomeDrive & "\ProgramData\EZDISM\GetWaikTools.exe") Then FileDelete(@HomeDrive & "\ProgramData\EZDISM\GetWaikTools.exe") EndIf If FileExists(@HomeDrive & "\ProgramData\EZDISM\ReadME.txt") Then FileDelete(@HomeDrive & "\ProgramData\EZDISM\ReadME.txt") EndIf FileInstall("C:\Program Files\Easy_DISM 2\Easy_DISM.exe", @ProgramFilesDir & "\Easy_DISM\Easy_DISM.exe", 1) FileInstall("C:\Program Files\Easy_DISM 2\Easy_DISM_x64.exe", @ProgramFilesDir & "\Easy_DISM\Easy_DISM_x64.exe", 1) FileInstall("C:\Program Files\Easy_DISM 2\EZ Download DISM 10.exe", @ProgramFilesDir & "\Easy_DISM\EZ Download DISM 10.exe", 1) FileInstall("C:\Program Files\Easy_DISM 2\GetWaikTools.exe", @ProgramFilesDir & "\Easy_DISM\EGetWaikTools.exe", 1) If GUICtrlRead($Checkbox1) = $GUI_CHECKED Then If @OSArch = "x86" Then FileCreateShortcut(@ProgramFilesDir & "\Easy_DISM\Easy_DISM.exe", @DesktopDir & "\Easy_DISM.exe") ElseIf @OSArch = "x64" Then FileCreateShortcut(@ProgramFilesDir & "\Easy_DISM\Easy_DISM_x64.exe", @DesktopDir & "\Easy_DISM.exe") EndIf EndIf Run(@ProgramFilesDir & "Easy_DISM\EZ Download DISM 10.exe") Exit EndSwitch WEnd This will get the ball rolling. Already downloaded InnoSetup should be no prob, if there is "I'll be Back".
-
Thanks Subz I took a quick look at InnoSetup and thought I may end up going that route eventually, biggest reason because of uninstall. I just wanted to see what I could accomplish with Autoit. Place shortcut in appdata\microsoft\windows\startmenu and it shows up in all apps in windows 8.1. I didn't think it would be so difficult to pin to the start page. Functions like Export ESD to WIM only available with DISM 10 make it necessary to have DISM 10 files available in Win 7 and 8.1. JFX has agreed to let me include GetWaikTools with Easy_DISM. This means I can fully automate the DISM 10 download and install process, only 10 mb download using GetWaik. I wanted to add the DISM download feature to the installer but no worries.
-
I want to create an installer for Easy_DISM using AutoIt. The basic installer and a desktop shortcut not a problem. Win 8.1 and 10 to PIN to start is a different matter. I found this little snippet Pin a shortcut to StartMenu @Subz you seem to be the man with the answers again, My Hero! Time for work so won't get a chance to try this till tomorrow but will this work in both Windows 8.1 and 10? I only have 2 or 3 programs to make shortcuts for, use the xml to arrange them and the powershell cmd to apply?