Jump to content
Sign in to follow this  
anixon

File Attributes

Recommended Posts

anixon

On file attributes in properties [Windows Vista] is set to 'Full Control' for all users at it is not hidden or read only. The following code has no effect and does not change the attributes of the file. The file name includes both letters and numbers contained within the file name $uKey variable. The file editor is 'NotePad'. I have tried both *.log and *.txt file extensions which also has no effect on the attributes.

$sTcLOG = @ScriptDir & "\sTc" & $uKey & ".log" 
$wRecord = "text variab le"

;//Set the file attributes
FileSetAttrib($sTcLOG, "-RSH+N")
$sTcFile = FileOpen($sTcLOG, 9)
FileWriteLine($sTcFile, $wRecord)
FileClose($sTcFile)
FileSetTime($sTcFile, "20031101", 1)
FileSetAttrib($sTcFile, "+RSH")

Assistance is always appreciated

Share this post


Link to post
Share on other sites
anixon

Solved by own problem. Had show hidden files switched on in Folder Options. Is it possible in AutoIT to switch/toggle this setting?

Share this post


Link to post
Share on other sites
Bowmore

On file attributes in properties [Windows Vista] is set to 'Full Control' for all users at it is not hidden or read only. The following code has no effect and does not change the attributes of the file. The file name includes both letters and numbers contained within the file name $uKey variable. The file editor is 'NotePad'. I have tried both *.log and *.txt file extensions which also has no effect on the attributes.

$sTcLOG = @ScriptDir & "\sTc" & $uKey & ".log" 
$wRecord = "text variab le"

;//Set the file attributes
FileSetAttrib($sTcLOG, "-RSH+N")
$sTcFile = FileOpen($sTcLOG, 9)
FileWriteLine($sTcFile, $wRecord)
FileClose($sTcFile)
FileSetTime($sTcFile, "20031101", 1)
FileSetAttrib($sTcFile, "+RSH")

Assistance is always appreciated

Your las 2 lines should be

FileSetTime($sTcLOG, "20031101", 1)
FileSetAttrib($sTcLOG, "+RSH")

"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the universe trying to build bigger and better idiots. So far, the universe is winning."- Rick Cook

Share this post


Link to post
Share on other sites
anixon

Your las 2 lines should be

FileSetTime($sTcLOG, "20031101", 1)
FileSetAttrib($sTcLOG, "+RSH")

Thanks for that sometimes you cannot see the woods for the trees Ant..

Share this post


Link to post
Share on other sites
Bowmore

Thanks for that sometimes you cannot see the woods for the trees Ant..

Your welcome I had the same problem seeing whats right in front of me myself many.

Note:

FileSetTime is not working in the current beta version 3.3.1.1 but has been fixed for the next release. It's working fine in the production release 3.3.0.0


"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the universe trying to build bigger and better idiots. So far, the universe is winning."- Rick Cook

Share this post


Link to post
Share on other sites
anixon

Your welcome I had the same problem seeing whats right in front of me myself many.

Note:

FileSetTime is not working in the current beta version 3.3.1.1 but has been fixed for the next release. It's working fine in the production release 3.3.0.0

Thanks for that what do they say 'So much to learn so little time' Ant.. [Ant.. for Anthony not Antipodean Australis]

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.