Acessing folders unnamed

Acessing folders unnamed

Ritratto di P R.

   Hello

      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 post / 0 new
Ultimo contenuto
Per informazioni complete sulle ottimizzazioni del compilatore, consultare l'Avviso sull'ottimizzazione
Ritratto di Steve Lionel (Intel)

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.

Steve
Ritratto di P R.

  Thanks a lot Steve

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

Ritratto di P R.

 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?

Ritratto di Steve Lionel (Intel)

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 http://forum.notebookreview.com/windows-os-software/330970-deleting-unna... for example./

Steve
Ritratto di P R.

  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)

Ritratto di Steve Lionel (Intel)

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.

Steve
Ritratto di P R.

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

Accedere per lasciare un commento.