halo1974 Posted May 12, 2010 Share Posted May 12, 2010 I have recently fallen in love with AutoIt. Thank you all for your wonderful help on this forum. I was testing a script from a topic "Adding progress bar to use with robocopy" and I modified the example without thinking I ran it. It moved a few folders and made them a "file". I cannot change the attribute back to a directory. Is there any hope? Thanks #include <File.au3> ; copy from AutoIt installed directory - possibly C:\Program files\AutoIt3\SciTE\cSnippet Local $CopyDirFrom = @MyDocumentsDir & "\My Videos" Local $CopyDirTo = "D:\2010Videos" Local $avarray, $text, $Pid $avarray = _FileListToArray($CopyDirFrom, "*.*") ProgressOn("Archiving Progress", "No. of files left to archive = " & $avarray[0], "0 percent done") For $i = 0 To $avarray[0] FileMove($CopyDirFrom & "\" & $avarray[$i], $CopyDirTo & "\" & $avarray[$i], 9) ProgressSet(Round(100 - ($i / $avarray[0] * 100), 1), _ StringFormat("%4.1f percent done", Round($i / $avarray[0] * 100, 1)), _ "No. of files left to archive = " & $avarray[0] - $i) Next ProgressOff ( ) Local $iBut = MsgBox(0, "Operation Done!","Done") If $iBut = 6 Then FileRecycle($CopyDirTo) Link to comment Share on other sites More sharing options...
halo1974 Posted May 12, 2010 Author Share Posted May 12, 2010 I have tried this - I know it says "D" cannot be set in the help If Not FileSetAttrib("c:\Test\1\*.*", "D") Then MsgBox(4096,"Error", "Problem setting attributes.") EndIf I also used the FileGetAttrib from help but I can't reverse engineer my oops. I edited this line to only include the .flv files in my next iteration of the script $avarray = _FileListToArray($CopyDirFrom, "*.flv") 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