Attributizer
Back over in this thread, I asked for help with a small project of mine. Now, I've expanded it into a program that I think I should share.
It's simple: Attributizer can quickly change the attributes of a file or folder. Although it you can make a file or folder Read-Only or Hidden through its Properties dialog, this program simplifies the process in an easy GUI, and it supports the System attribute as well.
It's not a big deal, but it's my first big thing, and I feel kinda proud of it
Screenshots:
Download it here (Version 0.60)
Personally I'd really appreciate the possibilty to change the filedates/-times (Created, Modified, Accessed) as well. Perhaps a good idea?
Greetings,
Marc
However, I recently learned of a bug in the program. I tried using it on my friend's Vista computer, but the installer wouldn't boot, and when I tried to run the script on it's own, it would open the GUI, but it wouldn't change the attributes of any files.
If anyone else has Vista, can they please give me feedback?
Sure a nice handy program with a nice GUI.
Personally I'd really appreciate the possibilty to change the filedates/-times (Created, Modified, Accessed) as well. Perhaps a good idea?
Greetings,
Marc
Here is my prototype GUI
I think it looks pretty functional. I'm going to make it so you can click the statusbar to switch between it showing the selection's main attributes and its date-related attributes.
Please test it out (especially on Vista) and tell me if it works
#notrayicon AGB_LoadIconDll(btn1, "shell32.dll", 4) Gui, Add, Edit, x6 y27 w320 vfolder , Gui, Add, Button, x336 y27 w30 gbrowse2, &... AddGraphicButtonGui("cauta", btn1, "x371 y27 w25 gbrowse") Gui, Add, Button, x406 y27 w100 gexecuta, Execute Gui, Add, CheckBox, x6 y57 h30 vs, System Gui, Add, CheckBox, x86 y57 h30 vh, Hidden Gui, Add, CheckBox, x166 y57 h30 vr, Read-only Gui, Add, CheckBox, x246 y57 h30 va, Archive Gui, Add, CheckBox, x326 y57 h30 vincdir, Include subdir Gui, Add, CheckBox, x426 y57 h30 vincf, Include files Gui, Add, Text, x16 y7 w440 h20 , Chose the file/folder you wish to modify Gui, Show, h81 w530, Attribute Modifier Return GuiClose: ExitApp browse: FileSelectFolder, folder1 if folder1 = return else guicontrol,enable,incdir guicontrol,enable,incf guicontrol,,s,0 guicontrol,,r,0 guicontrol,,h,0 guicontrol,,a,0 guicontrol,,folder,%folder1% Random, rand , 10000, 9999999 text=attrib "%folder1%" > %a_temp%\%rand%.txt fileappend,%text%, %a_temp%\%rand%.cmd runwait,%a_temp%\%rand%.cmd,,hide FileRead, read, %a_temp%\%rand%.txt StringReplace, read, read, %folder1%,, All StringReplace, read, read, %a_tab%,, All StringReplace, read, read, %a_space%,, All filedelete %a_temp%\%rand%.cmd filedelete %a_temp%\%rand%.txt IfInString, read, S guicontrol,,s,1 IfInString, read, R guicontrol,,r,1 IfInString, read, H guicontrol,,h,1 IfInString, read, A guicontrol,,a,1 return executa: gui,submit,nohide if folder= return if s=1 sys=+s if r=1 readonly=+r if a=1 archive=+a if h=1 hidden=+h if s=0 sys=-s if r=0 readonly=-r if a=0 archive=-a if h=0 hidden=-h if incdir=1 incldir=/d if incf=1 { inclf=/s ifn=\* } Random, rand , 10000, 9999999 text=attrib "%folder%%ifn%" %sys% %readonly% %archive% %hidden% %incldir% %inclf% > %a_temp%\%rand%.txt fileappend,%text%, %a_temp%\%rand%.cmd runwait,%a_temp%\%rand%.cmd,,hide FileRead, read, %a_temp%\%rand%.txt StringReplace, read, read, %folder1%,, All StringReplace, read, read, %a_tab%,, All StringReplace, read, read, %a_space%,, All filedelete %a_temp%\%rand%.cmd filedelete %a_temp%\%rand%.txt IfInString, read, S guicontrol,,s,1 IfInString, read, R guicontrol,,r,1 IfInString, read, H guicontrol,,h,1 IfInString, read, A guicontrol,,a,1 return browse2: FileSelectFile, folder1, 3, , Open a file if folder1 = return else guicontrol,,s,0 guicontrol,,r,0 guicontrol,,h,0 guicontrol,,a,0 guicontrol,,incdir,0 guicontrol,,incf,0 guicontrol,disable,incdir guicontrol,disable,incf guicontrol,,folder,%folder1% Random, rand , 10000, 9999999 text=attrib "%folder1%" > %a_temp%\%rand%.txt fileappend,%text%, %a_temp%\%rand%.cmd runwait,%a_temp%\%rand%.cmd,,hide FileRead, read, %a_temp%\%rand%.txt StringReplace, read, read, %folder1%,, All StringReplace, read, read, %a_tab%,, All StringReplace, read, read, %a_space%,, All filedelete %a_temp%\%rand%.cmd filedelete %a_temp%\%rand%.txt IfInString, read, S guicontrol,,s,1 IfInString, read, R guicontrol,,r,1 IfInString, read, H guicontrol,,h,1 IfInString, read, A guicontrol,,a,1 return AddGraphicButtonGui(VariableName, ImgPath, Options="", bHeight=32, bWidth=32,gui=1){ Global Local ImgType, ImgType1, ImgPath0, ImgPath1, ImgPath2, hwndmode ; BS_BITMAP := 128, IMAGE_BITMAP := 0, BS_ICON := 64, IMAGE_ICON := 1 Static LR_LOADFROMFILE := 16 Static BM_SETIMAGE := 247 Static NULL SplitPath, ImgPath,,, ImgType1 If ImgPath is float { ImgType1 := (SubStr(ImgPath, 1, 1) = "0") ? "bmp" : "ico" StringSplit, ImgPath, ImgPath,`. %VariableName%_img := ImgPath2 hwndmode := true } ImgTYpe := (ImgType1 = "bmp") ? 128 : 64 If (%VariableName%_img != "") AND !(hwndmode) DllCall("DeleteObject", "UInt", %VariableName%_img) If (%VariableName%_hwnd = "") Gui,%gui%: Add, Button, v%VariableName% hwnd%VariableName%_hwnd +%ImgTYpe% %Options% ImgType := (ImgType1 = "bmp") ? 0 : 1 If !(hwndmode) %VariableName%_img := DllCall("LoadImage", "UInt", NULL, "Str", ImgPath, "UInt", ImgType, "Int", bWidth, "Int", bHeight, "UInt", LR_LOADFROMFILE, "UInt") DllCall("SendMessage", "UInt", %VariableName%_hwnd, "UInt", BM_SETIMAGE, "UInt", ImgType, "UInt", %VariableName%_img) Return %VariableName%_img ; Return the handle to the image } AGB_LoadIconDll(ByRef VariableName, dllfile, nindex) { Global Local spid spid := DllCall("GetCurrentProcessId") If (%VariableName%_img != "") DllCall("DeleteObject", "UInt", %VariableName%_img) VariableName := "1." . DllCall("shell32.dll\ExtractIconA", "UInt", spid, "Str", dllfile, "UInt", nindex) Return ErrorLevel }
I think it is a really nice addition to the app.
However, perhaps I would be a good idea (?) to have 3 separate inputboxes (or calendar controls) for the 3 different dates/times, as well as an "Apply" or "Ok/Cancel" button? I now changed one of the dates by clicking one of the datetype buttons, assuming I was only switching to view that date! :lol: [My mistake, I know, but still somewhat confusing, perhaps.]
Greetings,
Marc
Thanks for the positive reply on my suggestion!
I think it is a really nice addition to the app.
However, perhaps I would be a good idea (?) to have 3 separate inputboxes (or calendar controls) for the 3 different dates/times, as well as an "Apply" or "Ok/Cancel" button? I now changed one of the dates by clicking one of the datetype buttons, assuming I was only switching to view that date! :lol: [My mistake, I know, but still somewhat confusing, perhaps.]
Greetings,
Marc
I understand, Marc. I'll try changing it up tomorrow.
I added a confirmation dialog to each of the Date-related buttons. That dialog can be turned off if desired through a new Options menu as well.
I don't really like how the times are displayed in the StatusBar (looks too cramped to me). Anyone have any suggestions?
Screenshot to illustrate point:
I still need feedback on the program running in Vista. I have a feeling it has something to do with Administrative privileges, but I'm not sure, and I can't test it since I don't have a Vista computer.If anyone could help, it would be greatly appreciated.
Thanks I was looking for something like this.
I like the calendar control :-)
A couple of things.
1) Yeah, it looks a bit cramped, but I don't see much to do...
May be change:
Directory to Folder (and match button)
Atributtes to Atrib.
2) If you fell like v0.7 would be nice to have an option to recourse on SubFolders (inc SubFolders only, Sub-Files only or Both)
Note: files will look weird all with the same timestamp mod, but the same happens when burning CDs etc and burner settings are not to keep original timestamps.
For that you may use a checkbox etc and If you make your GUI a bit larger the status bar will also look better
I got exited with the feedback LOL
3) Have a second Status bar to be able to include all Nomal and Time atributtes.
Cheers, Yogui
_____________________________