This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 7 years ago.
Improve this questionSome virus has named all the folders in the usb flash disk to foldername.lnk (the folder named games has been changed to games.lnk).Properties of the flash drive shows size of the folder as the disk space used.How do I restore the folder with batch file or vbscript?
Create a batch file and write this
attrib -h -s -r \s \d
this will change attributes of all files and folders at current directory
Update:
The following vbScript
will rename all folders having extension like folder_name.someExtension
and make them with previous names.
create 2 files:
1. script.vbs
2. rename.bat
script.vbs
Set objFS = CreateObject("Scripting.FileSystemObject")
strFolder = objFS.GetAbsolutePathName(".")
Set objFolder = objFS.GetFolder(strFolder)
For Each Folder In objFolder.SubFolders
Folder.Name=Mid(Folder.Name,1,InStrRev(Folder.Name,".")-1)
Next
rename.bat
cscript /nologo script.vbs
Place them is same folder where changed folder are. And run the rename.bat
file.
and That's it.
Enjoy :)
Using "attrib -h -s -r \s \d" immediately did the trick for me, except for one thing. The backslashes ( \ ) should both be forward slashes ( / ) So
attrib -h -s -r /s /d
But nontheless, many thanks to the original poster of the solution, because it really helped me. I just thought i'd point it out for other people who might need to do this.
Take it easy,,,with easiest Steps :-
Go to Control Panel
Open Folder Options
Go to "View" tab there
Sub Menu> Hidden Files and Folders
Tick the option i.e: Show hidden files and folders
Apply and Click Ok
Now Be Back to Hard Drive Containing Folders of .lnk extensions
There you will see your original folders (dim lightning)
Delete files/folders with .lnk extensions
and enjoy with your original folders....!
Hope this Helps...:-)
The Folders attributes must have been changed to Hidden+System+Readonly
. Delete the links. And enable "View Hidden Files"
and "View System Files"
to view your folders.
Cheers!
精彩评论