Jump to content
Sign in to follow this  
cyberbit

NEW! File Properties Modifier v0.2

Recommended Posts

cyberbit

post-75443-0-98877500-1375669386.png

Super Update!

Now supports full console actions and running commands from a text file! Run fropmod ? for options.

 

Using the GUI:

Drag and drop a file to the dropbox at the top.

 

To set a date/time pair to the current date and time, right mouse click the control and hit Set to Now.

 

Hold Shift to use alternate options.

 

Hash is a slightly trimmed MD5 of the entire file, so large files will take a bit to compute.

 

Using the CmdLine:

 

FropMod uses a linear-style command line interface. Commands are linked together to perform tasks. Files are loaded using

fropmod f <filename>

or, to be compatible with native Windows functionality,

fropmod <filename>.
 
* Note that this mode will only function if the only parameter is the filename.

Avoid using wildcards in the filename, as they will not always act as excepted. If the working directory is changed, FropMod will correctly handle relative paths.

 

Every command after f applies to the file passed to f. There is no save command, so each operation is applied immediately.

 

If ? is used, the GUI is automatically suppressed and further actions are ignored. ? is not valid except as the first parameter.

 

nogui may be used at any place in the command string, except within parameters of other commands. It will suppress the creation of the GUI, and cause FropMod to exit immediately after all commands are parsed.

 

Attributes (a) use the following format: +-RASHOT (Read-Only, Archive, System, Hidden, Offline, Temporary). The attributes N, D, and C (Normal, Directory, Compressed) are documented, but read-only. The Offline attribute is not compatible with files on removable drives. Additionally, Normal only appears when all other attributes are removed.

 

Dates (d[m|c|a]) use the following format: YYYYMMDDHHmmss. Use the 24hr clock. I think these are broken right now (?) but if they work for you, great.  :blink:

 

Opening the file as an archive (z) extracts dependencies into a temporary folder, then opens the file through it.

 

Only 63 parameters can be passed through the command line (including both commands and their values) due to AutoIt limitations, but larger strings can be used in an .fm1 script, and be run fully.

 

FropMod Scripts (.fm1) are run using the e command. Technically they can be of any extension, but I may add action verbs to these files to run on double click in the future.

 

Format of an .fm1 script:

[FMScript]
;comment
command [parameter] ;comment
command [parameter] ;comment
;comment
...

In an .fm1 script, there is no limit to the number of commands that will be parsed. Limit one command per line, as the parser will break if they are stacked. Comments can be by themselves or in-line with commands, using a semicolon. All white space is trimmed off the end of a command, as well.

 

Scripts may be called from other scripts. Used properly, this allows for complex building of batch processing. HOWEVER, DO NOT COMMIT A MAJOR PROGRAMMING SIN AND CALL A SCRIPT IN ITSELF! This will kick off an infinite recursion that will quickly drag your system down to a speed at which an Apple 2 could compete. Moral of the story: be careful.  ;)

 

The sources use the WinAPIEx and Resources UDFs.

 

Here's the updated source and dependencies: fropmodsrc0.2.zip

Modifies timestamps and attributes of files and directory trees. Can be used to fix EPOCHed files in some cases. Supports Drag & Drop. Supports console actions and text file scripts. Included in the archive is the source, examples and compiled x86/x64 EXEs with icon.

Previous versions:

fropmodsrc0.1.1.2.zip: 197 downloads

fropmodsrc0.1.0.2.zip: 63 downloads

fropmodsrc0.1.0.3.zip: 120 downloads

Changelog:

0.1.1.2 <12.18.2012>

Added:

- Title bar icon reflects file type

- Various button updates

- Catches for missing files

- Grayout for hash checkbox

Fixed:

- Directory renaming

Changed:

- Shift button functionality

- Preliminary message box to _WinAPI_MessageBoxCheck

Still to implement:

- Open as ZIP function

- Same as previous versions

0.1.0.3 <10.23.2012>

Added:

- Nothing

Fixed:

- Nothing

Changed:

- Removed _IsDir function in FileType

- Replaced references to _IsDir with _WinAPI_PathIsDirectory

Still to implement:

- Same as previous versions

0.1.0.2 <10.23.2012>

Added:

- Error capabilities to Delete function

- Loading text for file hashing during apparent freezes

Fixed:

- Nothing

Still to implement:

- Same as previous versions

0.1.0.1 <Initial release>

Still to implement:

- Directory functions

> Button changing if directory

> Function modification if directory

- Properties profiling

Regards,

Cyberbit

post-75443-0-98877500-1375669386_thumb.p

Edited by cyberbit
  • Like 1

_ArrayConcatenate2D · Aero Flip 3D · EPOCH (destroy timestamps) · File Properties Modifier · _GetFileType · UpdateEngine<new> · In-line Case (_ICase) <new>

[hr]

50% of the time, it works all the time. -PezoFaSho

Share this post


Link to post
Share on other sites
Melba23

cyberbit,

I wonder how many who downloaded it actually ran it? I only did so to check that it was indeed benign, given that you are unknown on the forum. :whistle:

Although you are perfectly at liberty to post only the compiled file, and in fact I will step in if anyone demands the source, both you and the community gain more if you post the original script. One of the great advantages of the forum is the chance to look over other peoples code and see how they did something - it is never too late to learn! And you will find people more willing to help if you offer something back. As an example, I would sugggest you learn how to strip unused constants and functions from your scripts using Obfuscator with the /StripOnly parameter - your .a3x files is 85k but I can get it down to only 13k by doing that. ;)

On another point, I am intrigued by your reference to "intellectual rights issues" as a reason for not posting the source. All I can see in that .a3x file are a few standard #include files (e.g. WinAPI, Misc, Crypt, GUIDateTimePicker, SendMessage), my NoFocusLines UDF and ~400 lines of not overly complex code which I presume were written by you. Just whose "intellectual rights" are at issue here? Please do not take this as anything other than a genuine interest on my part as to why you made that statement. And do not feel compelled to reply either - I am just being curious. :)

M23

P.S. You might want to think about changing your avatar though. As you can see from the Forum Rules (I hope you have read them, by the way) "game" is not a word with which you want to be closely associated here. ;)


Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______Open Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites
cyberbit

Hey Melba23,

Thanks for your reply, I always appreciate those who are helpful.

Being unknown is an unfortunate aspect of being new. I hope by trying to prove my non-malicious efforts my scripts will be more trusted. ^_^

I love the community of AutoIt and its open-source nature. I've learned countless things from you and other's UDFs, tips, and tricks. Learning AutoIt would be a pain without you guys!

I'll look into Obfuscator right now. That's a substantial size squish. ;)

In this case you're curiosity will be answered. I've had problems in other communities with stealing of rights to original work, so I ALWAYS start off any project with claiming "intellectual rights," basically an uber-abbreviated Creative Commons license. I do this often when I haven't fully completed a project, too, because if someone uses code that may do something unexpected due to unforeseen bugs, I don't want to get sued for the meltdown of a nuclear centrifuge. Actually, come to think of it, the EULA agreement tells you not to use it like that anyway. Heh. >_< A bit paranoid on my part, but I'm starting to trust this community more, so I'll slack off on that. Basically I'm wary of posting source for a project until I'm finished with it, unless I have a problem that I want solved or am in a good mood. I respect your genuine interest, and I hope that explanation suits you. :D

Just a quick note on NoFocusLines: I love your UDF. It's useful for all sorts of stuff. I'm still debating using it in FropMod because of the iffy "tabbing" capabilities. I'd much like my users to be able to quickly and easily TAB through the interface to select properties, but having no focus lines is a problem specifically with checkboxes, as there is no native "active" mode for Radio-style controls. I might use the control-specific settings in it, but I'm too lazy right now to implement it. ;)

Another reason I'm not posting the source quite yet is because it's very ugly and not really optimized too well. I'm working on that right now, actually.

Good tip on the avatar; didn't even think of that. I'll change it to P.B Solutions. XD

Regards,

Cyberbit


_ArrayConcatenate2D · Aero Flip 3D · EPOCH (destroy timestamps) · File Properties Modifier · _GetFileType · UpdateEngine<new> · In-line Case (_ICase) <new>

[hr]

50% of the time, it works all the time. -PezoFaSho

Share this post


Link to post
Share on other sites
lorenkinzel

Ran it.

Wow! for the industrial spy / sobateur this is just the ticket!

Seriously, though, it was a new learning experience for me.....

  • Like 1

Share this post


Link to post
Share on other sites
guinness

If you're using WinAPIEx then use _WinAPI_PathIsDirectory instead of _IsDir.


UDF List:

 
_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_ArrayFilter/_ArrayReduce_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_DotNet_Load()/_DotNet_Unload()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 22/04/2018

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Similar Content

    • litlmike
      By litlmike
      I had a hdd that crashed and upon receiving a replacement from my online backup, the Date Created, Date Modified, and Date Accessed were set to the date of the copy, and not the actual creation date.  I did find that for my .jpgs, under Details, there is a Date Taken field that has the correct data.  Can AutoIt be used to find the Date Taken, and then Set the Date Created to the value in Date Taken?  I've never seen any of these kinds of functions in AutoIt.  Thanks!
    • BrewManNH
      By BrewManNH
      This is a modification of a script that was originally posted back in 2006, that was itself a modification of a script in the same thread, which was a modification of another script linked in that thread. All credits remain in the header as to who contributed to this.
      The only credit I take in this script is modifying parts of it to:
      1.make it a bit faster, by removing a ReDim that was inside a loop
      2.add support for OSs other than XP because of the number of file properties returned
      3.add support for the future if the number of file properties returned changes again with future versions of Windows
      Please take note, this script will only work if you know the name of the property you're trying to retrieve. These properties are dependent upon the OS version, the OS language, and the file's properties. This function does not take any of these things into account, if you want to use this and make it OS neutral, you'll have to do that in your script, because it doesn't get done in here. Fortunately, if you access this function and leave the parameter $FGP_Property blank, it will return an array of all the properties that Windows knows about, and in the language that Windows is running in.
      Windows XP only returns 38 properties, Windows 7 returns 288, Windows 8 returns 290. The same properties can have different names depending on which OS you're using this with.
      Update Sept. 6, 2017
      Changed the code slightly to make sure the return includes all properties, the last update cut off some of the properties at the end, and increased the $iPropertyCount to 500 (from 300) because of Windows 10 file property count increase.
      Update: Jun-25-2013
      I have tweaked this function again, a small update.
      Added a new parameter to the function, $iPropertyCount, with a default setting of 300. This parameter was previously hard coded inside the function, now you are able to adjust it to the setting you desire/require. This value is used to determine how many file properties will be searched for the value passed in $FGP_PROPERTY, or the maximum amount of properties that will be returned in the array if $FGP_PROPERTY is a blank string. The $FGP_PROPERTY parameter will now accept the Default keyword in place of a blank string, which tells the function to return an array of all known properties, up to the setting of $iPropertyCount. Update: Feb-11-2013
      I have updated this function again.
      Now it has a single point of return, except for error exceptions, instead of multiple places that it returned from previously. I've renamed the variables used so that they'll be less chance of a name collision with someone's script. Fixed a small bug that added a blank line to the end of the array returned when getting all properties. Changed the return value on an error from 0 to an empty string. NOTE: This is a repost of a thread I had already posted last year. I went looking for it today to update the code in it, and found that it had disappeared.
      New code
      #include <File.au3> ; only used for the example script, not needed for the UDF #include <Array.au3> ; only used for the example script, not needed for the UDF #include <Constants.au3> ; only used for the MsgBox, not needed for the UDF $sFolder = FileSelectFolder("Select a folder to scan", "") $sFolder &= "" $aFiles = _FileListToArray($sFolder, "*.exe") For $I = 1 To $aFiles[0] $aDetails = _FileGetProperty($sFolder & "\" & $aFiles[$I]) ; Returns an array with all properties of the file _ArrayDisplay($aDetails) Next Global $sDetails = _FileGetProperty($sFolder & "\" & $aFiles[$aFiles[0]], "date modified") MsgBox($MB_SYSTEMMODAL, "Date Modified", $sDetails) ;=============================================================================== ; Function Name.....: _FileGetProperty ; Description.......: Returns a property or all properties for a file. ; Version...........: 1.0.2 ; Change Date.......: 05-16-2012 ; AutoIt Version....: 3.2.12.1+ ; Parameter(s)......: $FGP_Path - String containing the file path to return the property from. ; $FGP_PROPERTY - [optional] String containing the name of the property to return. (default = "") ; $iPropertyCount - [optional] The number of properties to search through for $FGP_PROPERTY, or the number of items ; returned in the array if $FGP_PROPERTY is blank. (default = 300) ; Requirements(s)...: None ; Return Value(s)...: Success: Returns a string containing the property value. ; If $FGP_PROPERTY is blank, a two-dimensional array is returned: ; $av_array[0][0] = Number of properties. ; $av_array[1][0] = 1st property name. ; $as_array[1][1] = 1st property value. ; $av_array[n][0] = nth property name. ; $as_array[n][1] = nth property value. ; Failure: Returns an empty string and sets @error to: ; 1 = The folder $FGP_Path does not exist. ; 2 = The property $FGP_PROPERTY does not exist or the array could not be created. ; 3 = Unable to create the "Shell.Application" object $objShell. ; Author(s).........: - Simucal <Simucal@gmail.com> ; - Modified by: Sean Hart <autoit@hartmail.ca> ; - Modified by: teh_hahn <sPiTsHiT@gmx.de> ; - Modified by: BrewManNH ; URL...............: http://www.autoitscript.com/forum/topic/34732-udf-getfileproperty/page__view__findpost__p__557571 ; Note(s)...........: Modified the script that teh_hahn posted at the above link to include the properties that ; Vista and Win 7 include that Windows XP doesn't. Also removed the ReDims for the $av_ret array and ; replaced it with a single ReDim after it has found all the properties, this should speed things up. ; I further updated the code so there's a single point of return except for any errors encountered. ; $iPropertyCount is now a function parameter instead of being hardcoded in the function itself. ;=============================================================================== Func _FileGetProperty($FGP_Path, $FGP_PROPERTY = "", $iPropertyCount = 500) If $FGP_PROPERTY = Default Then $FGP_PROPERTY = "" $FGP_Path = StringRegExpReplace($FGP_Path, '["'']', "") ; strip the quotes, if any from the incoming string If Not FileExists($FGP_Path) Then Return SetError(1, 0, "") ; path not found Local Const $objShell = ObjCreate("Shell.Application") If @error Then Return SetError(3, 0, "") Local Const $FGP_File = StringTrimLeft($FGP_Path, StringInStr($FGP_Path, "\", 0, -1)) Local Const $FGP_Dir = StringTrimRight($FGP_Path, StringLen($FGP_File) + 1) Local Const $objFolder = $objShell.NameSpace($FGP_Dir) Local Const $objFolderItem = $objFolder.Parsename($FGP_File) Local $Return = "", $iError = 0 If $FGP_PROPERTY Then For $I = 0 To $iPropertyCount If $objFolder.GetDetailsOf($objFolder.Items, $I) = $FGP_PROPERTY Then $Return = $objFolder.GetDetailsOf($objFolderItem, $I) EndIf Next If $Return = "" Then $iError = 2 EndIf Else Local $av_ret[$iPropertyCount + 1][2] = [[0]] For $I = 1 To $iPropertyCount If $objFolder.GetDetailsOf($objFolder.Items, $I) Then $av_ret[$I][0] = $objFolder.GetDetailsOf($objFolder.Items, $I - 1) $av_ret[$I][1] = $objFolder.GetDetailsOf($objFolderItem, $I - 1) ;~ $av_ret[0][0] += 1 $av_ret[0][0] = $I EndIf Next ReDim $av_ret[$av_ret[0][0] + 1][2] If Not $av_ret[1][0] Then $iError = 2 $av_ret = $Return Else $Return = $av_ret EndIf EndIf Return SetError($iError, 0, $Return) EndFunc ;==>_FileGetProperty Warning, old code below.
    • ripdad
      By ripdad
      Here is  another WMIC script that parses properties from various alias classes.
      ie: COMPUTERSYSTEM, CDROM, IDECONTROLLER, DISKDRIVE, etc.
      Download:  WMIC_GET.au3
       
    • ur
      By ur
      How to get the thrid number of a file version.
      Example: Let's say I have a file with below properties.
      I want only the third number like here it is 1941 as highlighted.
      Is there any built in function to get it??

    • ur
      By ur
      I have a custom configuration file which has key-value pairs as in below format.
      BuildLocation:C:\Build BuildExe:setup.exe Release:r9.64.02 Silent:No InstallPath:default Compare :No MartUpgrade :Yes Bit:64 ERwinUpgrade:No I need to change the value of "BuildExe" using my program.
      Is there any inbuilt function already available for these kind of files?.
      Can any one help me how to do this.
×