Jump to content

iamtheky

Member
  • Posts

    849
  • Joined

  • Last visited

  • Donations

    0.00 USD 
  • Country

    United States

Posts posted by iamtheky

  1. Or maintain the data in an ini. The following autoitscript will facilitate building an ini of data for whichever file you choose. This seems like it would be easier than maintaining copies of entire files, especially if you are not importing the metadata and entering it yourself anyway.

    Just select a file, then add a Key (e.g. "Artist") , then add the data (e.g. "firstname lastname"). On subsequent runs if data already exists for the file selected it will display that data prior to the inputboxes. It will build the ini in the directory the script is ran from.




    #include<array.au3>

    $file = FileOpenDialog("Select File" , @ScriptDir , "ALL(*.*)" , 1)
    $aINI = inireadsection(@ScriptDir & "\metadata.ini" , $file)
    If @Error <> 1 Then _Arraydisplay ($aINI)
    $key = inputbox("Add Key" , "What type of data is this (one word)" , "Artist")
    If @Error = 1 Then Exit
    $input = inputbox("Add Data" , "Add the Data" , "FirstName LastName")
    iniwrite(@ScriptDir & "\metadata.ini" , $file , $key , $input)


  2. yeah it probably had nothing to do with the forums being jacked the past week. just as bphlpt couldnt see the attachment, most likely because it still wasnt there 9 hours after being posted, not because he is being dense.

    Just saying you could probably give folk a pass on any oddities you notice.

  3. Here is an autoit solution. In my test:

    1) The Folder list is a txt file named 'FolderList.txt' and is relative to the script

    2) The Files are all in a folder named 'Files' (also relative to the script). The files can be scattered in sub folders beneath that folder.

    Upon execution it will create a folder named 'Folders', and beneath, for all files that contain one of the strings from the list in their name, it will create the folder using the name from the list and copy the file to that destination.

    RecFileListToArray UDF

    #include<RecFileListToArray.au3>
    #include<File.au3>

    Dim $FolderArr

    _FileReadToArray("Folderlist.txt" , $FolderArr)

    $FilesArr = _RecFileListToArray(@ScriptDir & "\Files" , "*" , 1 , 1)

    For $i = 1 to ubound($FilesArr) - 1
    For $k = 1 to ubound($FolderArr) - 1
    If stringinstr($FilesArr[$i] , $FolderArr[$k]) Then
    DirCreate (@ScriptDir & "\Folders\" & $FolderArr[$k])
    FileCopy(@ScriptDir & "\Files\" & $FilesArr[$i] , @ScriptDir & "\Folders\" & $FolderArr[$k])
    EndIf
    Next
    Next

  4. So if you set as policy the behavior you want:

    Specify the Unattended Sleep Timeout (plugged in) , enabled, and set to 0.

    If you enable this policy setting, you must provide a value, in seconds, indicating how much idle time should elapse before Windows automatically transitions to sleep when left unattended. If you specify 0 seconds, Windows will not automatically transition to sleep.

    Does it still timeout?

  5. Im reworking an AutoIt version of an integrity checker, this may give you the means to roll your own...


    #include <Crypt.au3>
    #include<RecFileListToArray.au3>
    #Include <File.au3>
    #Include <Array.au3>
    #include <WindowsConstants.au3>
    #Include <WinAPIEx.au3>

    _CreateHashFile()

    sleep (2000)

    _CheckHashFile()


    Func _CreateHashFile()

    $path = FileSelectFolder ("Select Directory" , "c:" , 2)

    $Farray = _RecFileListToArray ($path ,"*" , 1 , 1 , 1 , 2)

    Dim $HashArray[$Farray[0] + 1]
    Dim $ComboArray[$Farray[0] + 1]

    For $i = 1 to $Farray[0]
    $HashArray[$i] = _Crypt_HashFile($Farray[$i], $CALG_SHA1)
    Next

    For $n = 1 to $Farray[0]
    $ComboArray[$n] = $Farray[$n] & "||" & $HashArray[$n]
    Next

    $ComboArray[0] = $path

    _FileWriteFromArray (@ScriptDir & "\hashfile.txt" , $ComboArray , 0)

    EndFunc


    ;;;===============================CHECKING AN EXISTING FILE====================================

    Func _CheckHashFile()

    $GUI = GUICreate("", @DesktopWidth, @DesktopHeight, 0, 0, $WS_POPUP, $WS_EX_LAYERED)
    GUISetBkColor(1, $GUI)
    _WINAPI_SETLAYEREDWINDOWATTRIBUTES($GUI, 1, 255)
    GUISetState(@SW_SHOW)

    Dim $ReadArray
    _FileReadToArray(@ScriptDir & "\hashfile.txt" , $ReadArray)
    $path = $ReadArray[1]
    _ArrayDelete($ReadArray , 0)


    $FArray = _RecFileListToArray ($path ,"*" , 1 , 1 , 1 , 2)

    Dim $HashArray[$Farray[0] + 1]
    Dim $ComboArray[$Farray[0] + 1]

    For $i = 1 to $Farray[0]
    $HashArray[$i] = _Crypt_HashFile($Farray[$i], $CALG_SHA1)
    Next

    For $n = 1 to $Farray[0]
    $ComboArray[$n] = $Farray[$n] & "||" & $HashArray[$n]
    Next

    $ComboArray[0] = $path


    ;~ ;FIND MISSING ELEMENTS

    For $S = 0 To UBound($ReadArray) - 1
    _ARRAYSEARCH($ComboArray, $ReadArray[$S])
    If @error = 6 Then
    GUISetBkColor(16711680, $GUI)
    ExitLoop
    EndIf
    Next
    For $K = UBound($ComboArray) - 1 To 0 Step -1
    $FIND = _ARRAYFINDALL($ReadArray, $ComboArray[$K])
    For $M = UBound($FIND) - 1 To 0 Step -1
    _ARRAYDELETE($ReadArray, $FIND[$M])
    Next
    Next


    $MISSINGARRAY = $READARRAY
    _ArrayDisplay($MissingArray , "Missing or Modified Files")
    If NOT IsArray ($missingArray) Then $flag = 0


    ;FIND ADDED or Modified Elements

    _FileReadToArray(@ScriptDir & "\hashfile.txt" , $ReadArray)
    $path = $ReadArray[1]
    _ArrayDelete($ReadArray , 0)

    For $K = UBound($READARRAY) - 1 To 0 Step -1
    $FIND = _ARRAYFINDALL($ComboARRAY, $READARRAY[$K])
    For $M = UBound($FIND) - 1 To 0 Step -1
    _ARRAYDELETE($ComboARRAY, $FIND[$M])
    Next
    Next

    $ADDEDARRAY = $ComboARRAY
    _ArrayDisplay($AddedArray , "Added or Modified Files")
    If NOT IsArray ($AddedArray) And $flag = 0 Then msgbox(0, '' , "Directory contents are the same")

    _ArrayConcatenate($AddedArray , $MissingArray)
    _ArrayDisplay($AddedArray , "All Modifications")

    EndFunc











  6. that is hella odd if WinPE can format and copy, but not unpack. and it is failing as soon as you kick off the /apply? can 7zip unpack the wim once staged, its not a path or access issue, or bad copy from media? We have seen issues with disks, but they are not revealed until the restart and windows is actually trying to start. Since everything else is just an unpack.

  7. Thanks, having you both answer is a rare gift. I will confirm/deny the component discrepancy between the machines, and if needed add the cab with DISM.

    update: The Ink component was indeed the difference, that box serves handheld computers which have touch input. But i will certainly explore whether it is needed because with our app the pen input is only used for selection of controls (like a simulated left click). Thank you again.

  8. I have (2) server 2008 R2 systems, they are from the same baseline and generally receive the same patches.

    I am installing KB2660649 manually, it applied to the first, but i received "not applicable to your computer" on the second. Any likely culprits for this behavior?

  9. our solution is to not do any rearming on the "Master". We:

    1) run a basic sysprep generalize

    2) capture the image (and make a backup copy to another disk)

    4) /mountrw the capture and drop a setupcomplete.cmd that has the rearm instructions.

    This keeps the master clean, provides a backup if we need it, and rearms the targets.

  10. I've not used this, but maybe <InstallToAvailablePartition>true expects a partition rather than a blank disk?

    along these lines:

    did you format the VHD first? We have only had issues when it is a "bare metal" disk (as is the behavior of a newly snapped in .vhd), adding a simple format command (or diskpart directives) to startnet.cmd remedied virtual disk issues for us.

×
×
  • Create New...