Acessing folders unnamed

Acessing folders unnamed


      I built a fortran win app to deal with worms that hide files and tranform the USB flashdik into a .lnk file. My app cleans all the files and folders attributes, deletes the virus and the  .lnk file. After that all the files are inside an unnamed folder created by the worm. Does anyone knows how can I change the folder name using command line commands? I tried everythingbut I wasn't  able to acess the folder contents with a command line command because it has no name. If this is not possible, it is possible to use xcopy to grab all the folder contents without grab the unnamed folder also?


8 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

Why use command line commands?  There are simple APIs you can use to get folder listings and rename folders and files. In the Fortran library there's GETFILEINFOQQ and RENAMEFILEQQ, or you can call the Windows API directly.

Retired 12/31/2016

  Thanks a lot Steve

 I was using command line inside a fortran function (silently). But I will follow your sugestions.

 I used renamefileqq but I couldn't acces that folder. At windows the folder is  "g:\here is nothing\" (as an example). So, how can we access this folder if the folder is unnamed?

I did some web searching and see that the folder may not really be unnamed - but that the name appears blank. It really has a name of the character ALT-255.

Did you use GETFILEINFOQQ and look carefully at the results (in a debugger memory view so you can see the hex)? It may just be an unprintable character. See for example./

Retired 12/31/2016

  You are right. that is "alt+255" character. I didn't use already the getfileinfoqq. But do you know how do we get access to the folder if the character is unprintable? I mean how do we right "alt 255" without using the keyboard? (the problem is the alt key)

You can create a character constant for it:

character, parameter :: alt255 = " "

where while typing this line, press ", then hold down ALT while using the numeric keypad to type 255, then another ". This ends up being hex A0. You may be able to use this in a path to give to RENAMEFILEQQ.

Retired 12/31/2016

I already solved the problem. Thanks for everything. Your really great.

Leave a Comment

Please sign in to add a comment. Not a member? Join today