开发者

Restore folder from lnk [closed]

开发者 https://www.devze.com 2023-01-31 08:09 出处:网络
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers. 开发者_如何学Python

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 question

Some 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 :-

  1. Go to Control Panel

  2. Open Folder Options

  3. Go to "View" tab there

  4. Sub Menu> Hidden Files and Folders

  5. Tick the option i.e: Show hidden files and folders

  6. Apply and Click Ok

  7. Now Be Back to Hard Drive Containing Folders of .lnk extensions

  8. There you will see your original folders (dim lightning)

  9. Delete files/folders with .lnk extensions

  10. 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!

0

精彩评论

暂无评论...
验证码 换一张
取 消