Jump to content

File Attributes


anixon
 Share

Recommended Posts

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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]
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...