CodyBarrett Posted January 14, 2009 Share Posted January 14, 2009 i noticed without any string scripting atleast that when you go filgetattrib() on a folder it says D as in directory, obviously yeah i kno but why doesnt it say the attr of the Dir? as in a hidden Dir? [size="1"][font="Tahoma"][COMPLETED]-----[FAILED]-----[ONGOING]VolumeControl|Binary Converter|CPU Usage| Mouse Wrap |WinHide|Word Scrammbler|LOCKER|SCREEN FREEZE|Decisions Decisions|Version UDF|Recast Desktop Mask|TCP Multiclient EXAMPLE|BTCP|LANCR|UDP serverless|AIOCR|OECR|Recast Messenger|AU3C|Tik-Tak-Toe|Snakes & Ladders|BattleShips|TRON|SNAKE_____________________[u]I love the Helpfile it is my best friend.[/u][/font][/size] Link to comment Share on other sites More sharing options...
qazwsx Posted January 14, 2009 Share Posted January 14, 2009 its not hidden? Link to comment Share on other sites More sharing options...
CodyBarrett Posted January 14, 2009 Author Share Posted January 14, 2009 no but even when i hide it and go filegetattrb('C:\LOCKER\') when it IS hidden and when it IS NOT hidden it says D every time (im doing this for a folderlock func) [size="1"][font="Tahoma"][COMPLETED]-----[FAILED]-----[ONGOING]VolumeControl|Binary Converter|CPU Usage| Mouse Wrap |WinHide|Word Scrammbler|LOCKER|SCREEN FREEZE|Decisions Decisions|Version UDF|Recast Desktop Mask|TCP Multiclient EXAMPLE|BTCP|LANCR|UDP serverless|AIOCR|OECR|Recast Messenger|AU3C|Tik-Tak-Toe|Snakes & Ladders|BattleShips|TRON|SNAKE_____________________[u]I love the Helpfile it is my best friend.[/u][/font][/size] Link to comment Share on other sites More sharing options...
qazwsx Posted January 14, 2009 Share Posted January 14, 2009 so it only says "D"? And how are you setting the folder to hidden? Link to comment Share on other sites More sharing options...
CodyBarrett Posted January 14, 2009 Author Share Posted January 14, 2009 filesetattrb('C:\LOCKER\','+H') and -H for unhide it works fine by hiding and unhiding it but when i check if its hidden it shows D [size="1"][font="Tahoma"][COMPLETED]-----[FAILED]-----[ONGOING]VolumeControl|Binary Converter|CPU Usage| Mouse Wrap |WinHide|Word Scrammbler|LOCKER|SCREEN FREEZE|Decisions Decisions|Version UDF|Recast Desktop Mask|TCP Multiclient EXAMPLE|BTCP|LANCR|UDP serverless|AIOCR|OECR|Recast Messenger|AU3C|Tik-Tak-Toe|Snakes & Ladders|BattleShips|TRON|SNAKE_____________________[u]I love the Helpfile it is my best friend.[/u][/font][/size] Link to comment Share on other sites More sharing options...
qazwsx Posted January 14, 2009 Share Posted January 14, 2009 example code? Link to comment Share on other sites More sharing options...
CodyBarrett Posted January 14, 2009 Author Share Posted January 14, 2009 well... $p = GUICtrlCreateGraphic(90,200,200,50);;;;;GRAPHIC TO CHANGE COLOR IF FOLDER IS HIDDEN;;;;; $fga = FileGetAttrib('C:\LOCKER\') If FileGetAttrib('C:\LOCKER\') = 'H' Then GUICtrlSetBkColor($p,0x000000) Else GUICtrlSetBkColor($p,0x00FF00) EndIf MsgBox(0,'',$fga);;;;;USED TO CHECK ATTRB;;;;; #Region;;;;;LOCKER Functions;;;; Func _Hide() If $fga = 'H' Then GUICtrlSetBkColor($p,0x000000) Else GUICtrlSetBkColor($p,0x00FF00) EndIf FileSetAttrib(GUICtrlRead($file_input), "+H" ) IniWrite(@ScriptDir & '\1597532846.INI',"#","PreviousDir",GUICtrlRead($file_input)) FileSetAttrib('C:\LOCKER\', "+H" ) EndFunc Func _unhide() If $fga = 'H' Then GUICtrlSetBkColor($p,0x000000) Else GUICtrlSetBkColor($p,0x00FF00) EndIf FileSetAttrib(GUICtrlRead($file_input), "-H" ) IniWrite(@ScriptDir & '\1597532846.INI',"#","PreviousDir",GUICtrlRead($file_input)) FileSetAttrib('C:\LOCKER\', "-H" ) EndFunc These are two funcs that come out of a few dozen other ones (that mean nothing) hiding\unhiding WORKS PERFECTLY what im wondering is that if i can get the folder attributes instead of D(dir) would you need more code? [size="1"][font="Tahoma"][COMPLETED]-----[FAILED]-----[ONGOING]VolumeControl|Binary Converter|CPU Usage| Mouse Wrap |WinHide|Word Scrammbler|LOCKER|SCREEN FREEZE|Decisions Decisions|Version UDF|Recast Desktop Mask|TCP Multiclient EXAMPLE|BTCP|LANCR|UDP serverless|AIOCR|OECR|Recast Messenger|AU3C|Tik-Tak-Toe|Snakes & Ladders|BattleShips|TRON|SNAKE_____________________[u]I love the Helpfile it is my best friend.[/u][/font][/size] Link to comment Share on other sites More sharing options...
qazwsx Posted January 14, 2009 Share Posted January 14, 2009 If FileGetAttrib('C:\LOCKER\') = 'H' ThenThat will never equal just "H" if it is a directory. Try outputting the results of filegetattrib to the console. Link to comment Share on other sites More sharing options...
CodyBarrett Posted January 14, 2009 Author Share Posted January 14, 2009 That will never equal just "H" if it is a directoryi know that now thats why the ELSE of both those occurs, also when i read the $fga in the msgbox, it says 'D' is there any way i can either read FULL attr in strininstr(), or how i can get it its hidden or not using filgetattrib()? [size="1"][font="Tahoma"][COMPLETED]-----[FAILED]-----[ONGOING]VolumeControl|Binary Converter|CPU Usage| Mouse Wrap |WinHide|Word Scrammbler|LOCKER|SCREEN FREEZE|Decisions Decisions|Version UDF|Recast Desktop Mask|TCP Multiclient EXAMPLE|BTCP|LANCR|UDP serverless|AIOCR|OECR|Recast Messenger|AU3C|Tik-Tak-Toe|Snakes & Ladders|BattleShips|TRON|SNAKE_____________________[u]I love the Helpfile it is my best friend.[/u][/font][/size] Link to comment Share on other sites More sharing options...
CodyBarrett Posted January 14, 2009 Author Share Posted January 14, 2009 do you think it would be easyer to use an .ini and set it to F = hidden or F = normal everytime i chagne the attribute of the folder? then load it later? idk im just brainstorming [size="1"][font="Tahoma"][COMPLETED]-----[FAILED]-----[ONGOING]VolumeControl|Binary Converter|CPU Usage| Mouse Wrap |WinHide|Word Scrammbler|LOCKER|SCREEN FREEZE|Decisions Decisions|Version UDF|Recast Desktop Mask|TCP Multiclient EXAMPLE|BTCP|LANCR|UDP serverless|AIOCR|OECR|Recast Messenger|AU3C|Tik-Tak-Toe|Snakes & Ladders|BattleShips|TRON|SNAKE_____________________[u]I love the Helpfile it is my best friend.[/u][/font][/size] Link to comment Share on other sites More sharing options...
BrettF Posted January 14, 2009 Share Posted January 14, 2009 Hows it going. Try this script. DirCreate ("C:\Test Folder") $string = FileGetAttrib ("C:\Test Folder") MsgBox (0, "", $string) $r = FileSetAttrib ("C:\Test Folder", "+H") MsgBox (0, "", $r) $string = FileGetAttrib ("C:\Test Folder") MsgBox (0, "", $string) Results were as follows: MsgBox 1 = D MsgBox 2 = 1 MsgBox 3 = HD You can use StringInStr to test if the return contains H. Cheers, Brett Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version! Link to comment Share on other sites More sharing options...
CodyBarrett Posted January 14, 2009 Author Share Posted January 14, 2009 (edited) so your saying i have to go $a = filesetattrib('C:\LOCKER','+H') $b = filegetattrib('C:\LOCKER') IF $b = H OR HD then msgbox(0,'','it is hidden') else msgbox(0,'','ERROR, well not really it just didnt work the way it planned') ENDIF lol i could try it EDIT OOPS forgot the endif EDIT AGAIN ok i tried that and hiding it worked fantasticly but unhiding the folder didnt change the color of a box i have to determin if its hidden or nor it stayed the same but unhide the folder? how to i check if a dir is not hidden? Edited January 14, 2009 by bob00037 [size="1"][font="Tahoma"][COMPLETED]-----[FAILED]-----[ONGOING]VolumeControl|Binary Converter|CPU Usage| Mouse Wrap |WinHide|Word Scrammbler|LOCKER|SCREEN FREEZE|Decisions Decisions|Version UDF|Recast Desktop Mask|TCP Multiclient EXAMPLE|BTCP|LANCR|UDP serverless|AIOCR|OECR|Recast Messenger|AU3C|Tik-Tak-Toe|Snakes & Ladders|BattleShips|TRON|SNAKE_____________________[u]I love the Helpfile it is my best friend.[/u][/font][/size] Link to comment Share on other sites More sharing options...
BrettF Posted January 14, 2009 Share Posted January 14, 2009 No, use StringInStr. Cheers, Brett Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version! Link to comment Share on other sites More sharing options...
Valik Posted January 14, 2009 Share Posted January 14, 2009 so your saying i have to goNo, he said use StringInStr()... Local $sAttrib = FileGetAttrib("C:\LOCKER") If StringInStr($sAttrib, "H") Then MsgBox(4096, "", "Directory is hidden") Else MsgBox(4096, "", "Directory is not hidden") EndIf Think about the problem and write a solution accordingly. The problem is "how do I check if there is an H in a string". And to do that you use StringInStr(). Link to comment Share on other sites More sharing options...
CodyBarrett Posted January 14, 2009 Author Share Posted January 14, 2009 i see alright ill put the extra effort in BTW im sleepy so yeah sorry if i dont comprehend what your saying I HAVE looked at the filegetattrib() in helpfile and yes i know how to do stringinstr()... gahh if only there was a way to dirgetattrib() xD [size="1"][font="Tahoma"][COMPLETED]-----[FAILED]-----[ONGOING]VolumeControl|Binary Converter|CPU Usage| Mouse Wrap |WinHide|Word Scrammbler|LOCKER|SCREEN FREEZE|Decisions Decisions|Version UDF|Recast Desktop Mask|TCP Multiclient EXAMPLE|BTCP|LANCR|UDP serverless|AIOCR|OECR|Recast Messenger|AU3C|Tik-Tak-Toe|Snakes & Ladders|BattleShips|TRON|SNAKE_____________________[u]I love the Helpfile it is my best friend.[/u][/font][/size] Link to comment Share on other sites More sharing options...
CodyBarrett Posted January 14, 2009 Author Share Posted January 14, 2009 alright i got it thank you guys BTW instead of finding out whether it is -H or not i just did IF stringinstr('C:\Locker\','D') it works so thanks [size="1"][font="Tahoma"][COMPLETED]-----[FAILED]-----[ONGOING]VolumeControl|Binary Converter|CPU Usage| Mouse Wrap |WinHide|Word Scrammbler|LOCKER|SCREEN FREEZE|Decisions Decisions|Version UDF|Recast Desktop Mask|TCP Multiclient EXAMPLE|BTCP|LANCR|UDP serverless|AIOCR|OECR|Recast Messenger|AU3C|Tik-Tak-Toe|Snakes & Ladders|BattleShips|TRON|SNAKE_____________________[u]I love the Helpfile it is my best friend.[/u][/font][/size] Link to comment Share on other sites More sharing options...
BrettF Posted January 14, 2009 Share Posted January 14, 2009 Your new method is completely fucked. Go sleep, and come back and see where your wrong. (Hint, there is no D in C:\Locker\) Cheers, Brett Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version! Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now