Sign in to follow this  
Followers 0
badguy

Help needec - accidently data lost on wrong autoit command

13 posts in this topic

Hi Guys,

Accidently I have used the filemove command to rename a directory.

Now I have got a hugh list of files (which should be a directory).

How can I change the files to be a directory?

Any hints?

//badguy

Share this post


Link to post
Share on other sites



Hi Mandar,

nice idea - but a filemove or dirmove didn't createa a directory from the files.

It seems I musst change some attributs, but I have no clue which ones and howto

//badbuy

Share this post


Link to post
Share on other sites

Just pull up the backup you made of the directory that you put away safely before you ran the script.


George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Share this post


Link to post
Share on other sites

Just pull up the backup you made of the directory that you put away safely before you ran the script.

If he had a backup, he wouldn't have made this topic.

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

Write a script to reverse the damage you've done with the other script.

and put both in an infinite while do loop so the errata and errorfixer run in a eternal tango of purpose. :D

anyway,

seriously though, you can get the file list in an array. using the string commands strip the directory part and get the file name in another array.

Start a for loop to last till the number fo files.

Then rename all files (file+folder name) to the (file) name. just check if the file name is same as stringright of the file+folder name.

close for loop.

now you should have a directory full of files with correct names.

now just run a correct filemove script or just copy paste them manually.

let me know if any more specifics are required.

regards

Rishav

ps. throw in some code. i just realized that what i said is probably useless for you. :D

pps.

lemme know if the prob is

current file names:

xxxxfolder\xxxfile1.ext

xxxxfolder\xxxfile2.ext

xxxxfolder\xxxfile3.ext

.....

.....

Correct file names:

file1.ext

file2.ext

file3.ext

...

....

your problem being that the number of files is so large, you can't rename them manually?

Edited by Rishav

Share this post


Link to post
Share on other sites

badguy, I have tried what you were doing:

Accidently I have used the filemove command to rename a directory.

Now I have got a hugh list of files (which should be a directory).

This was my reproduction script:

FileMove("roflwin", "lolwat")

roflwin is a directory in the same place as the script. I have run the script and the roflwin directory is still there.

Can you give more details on the circumstances of this behavior?

Share this post


Link to post
Share on other sites

Hi Manadar,

thanks for the hint. You made my day...

As the original folders were about 1000 and the so resulting wrong files were also about 1000, I had forgotten to scroll down and didn't realize the still existing orignal folders...

If I come over one day to Alkmaar, you will get a crate of Dortmunder beer ;o)

//badguy

Share this post


Link to post
Share on other sites

i never get any love. :D

Share this post


Link to post
Share on other sites

If he had a backup, he wouldn't have made this topic.

You must be kidding me. I would never have guessed that there are still people out there who will test a script without backups. That's simply amazing and I may not get over the shock of hearing about it.

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

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  
Followers 0