Jump to content
Sign in to follow this  
dirty

HELP i renamed folder into file

Recommended Posts

dirty

i was messing around with this script

$FileOpenDialog = FileSelectFolder ("Please open file","C:\Users\Administrator\Desktop\Bible","")
$FileFind = FileFindFirstFile ($FileOpenDialog & "\*")
while 1
    $FileFindNext = FileFindNextFile ($FileFind)
    If @error Then ExitLoop
    If StringTrimRight ($FileFindNext,4) < 10 Then
        $Zeros = "00"
        FileMove ($FileOpenDialog & '\' & $FileFindNext,$FileOpenDialog & '\' & $Zeros & $FileFindNext,1)
    ElseIf StringTrimRight ($FileFindNext,4) < 100 Then
        $Zeros = "0"
        FileMove ($FileOpenDialog & '\' & $FileFindNext,$FileOpenDialog & '\' & $Zeros & $FileFindNext,1)
    EndIf
WEnd

and then when i looked into the root of my HDD i found few folder contents were moved into the root of current HDD and were kinda packed into one file that i cant open

Somehow contents of a folder ended up being one file and i dont know how to reverse it now.

I had this issue before and thank god i have backup, but still.

i attached the smallest file i could find.

I had to rename it to 000.au3 because forum wont accept 000 without extension, so you have to rename file back to 000

Thats right, that file has no extension just like folder, so this got me very confused.

Thanks in advance

000.au3

Edited by dirty

Share this post


Link to post
Share on other sites
wakillon

Here is the content of your txt file

# SciTE session file

buffer.1.path=F:\Autoit projects\ShutDowner\Source\ShutDowner.au3

buffer.1.position=6041

buffer.1.current=1

buffer.1.folds=99,122,125,128,131,134,142,146,157,161,171,175,181,197


AutoIt 3.3.14.2 X86 - SciTE 3.6.0WIN 8.1 X64 - Other Example Scripts

Share this post


Link to post
Share on other sites
dirty

Ok how about a 46MB file just like that that before was drivers for my pc ?

There were 7 files got somehow turned into this 1 file.

I thing autoit can move folder into a file that windows doesnt know how to handle, but is there a way to reverse it ?

FileMove ("C:\Users\Administrator\Desktop\01","C:\Users\Administrator\Desktop\Name")

having file inside folder 01 will turn them all into file called "Name" and i cant do anything with it.

How do i reverse this ?

LOL moving folder as a file. I think its a bug

Thanks

Edited by dirty

Share this post


Link to post
Share on other sites
wakillon

Ok how about a 46MB file just like that that before was drivers for my pc ?

There were 7 files got somehow turned into this 1 file.

I thing autoit can move folder into a file that windows doesnt know how to handle, but is there a way to reverse it ?

FileMove ("C:\Users\Administrator\Desktop\01","C:\Users\Administrator\Desktop\Name")

having files inside folder 01 will turn them all into 1 single file called "Name" and i cant do anything with it.

How do i reverse this ?

Thanks

Sorry, i don't think so ! Posted Image


AutoIt 3.3.14.2 X86 - SciTE 3.6.0WIN 8.1 X64 - Other Example Scripts

Share this post


Link to post
Share on other sites
dirty

gotta be a way man.

everything can be reversed. i dont think the structure of a file is changed, whats changed is the way its presended to windows.

I thing Linux might read it with no problem but i dont want to test that since i really dont like linux for its (gay) hardware support and complexity of choosing/partitioning hard drive for installation. It doesnt seem to understand hard drive labels at all, its all dev1 dev2 dev3

Hell i have 4 hdd's with same serial number and space, how am i suppose to deal with that ? LOL but thats another story.

Share this post


Link to post
Share on other sites
BrewManNH

I'm guessing what happened is, is that you moved the contents of the folder one file at a time and ended up renaming them to the target file name rather than copying them into a new folder. All of the files got moved to the same file name. So, that means the file isn't all of the files, it's just the last file to be moved.


If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Share this post


Link to post
Share on other sites
dirty

What ever it,regardless how files got moved into files ......Speaking if which, how files can be moved into files anyway ?

LOL this is mind blowing

If its the last file to be moved, then all i need to know is which one it was, gave it the correct extension (in this case mp3) and it will work... hmmm

This enplanes what happens in the process and i now see that in this loop it moves it one at the time and finished with the last one overwriting the previous once.

Because it happens so fast i didn't think that it moves it one at the time and finishes with the last file simply be named "output" without extension.

I guess i needed to be this stupid to come up with an issue like that.

Lol

Its all clear now Thanks to BrewManNH with "it's just the last file to be moved"

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.