Jump to content
Sign in to follow this  
halo1974

filemove moved my folder

Recommended Posts

halo1974

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)

Share this post


Link to post
Share on other sites
halo1974

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")

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.