Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

Acessing folders unnamed

Rodrigues__Pedro
Beginner
1,202 Views

   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?

 

0 Kudos
7 Replies
Steven_L_Intel1
Employee
1,202 Views

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.

0 Kudos
Rodrigues__Pedro
Beginner
1,202 Views

  Thanks a lot Steve

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

0 Kudos
Rodrigues__Pedro
Beginner
1,202 Views

 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?

0 Kudos
Steven_L_Intel1
Employee
1,202 Views

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-unnamed-folder.html for example./

0 Kudos
Rodrigues__Pedro
Beginner
1,202 Views

  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)

0 Kudos
Steven_L_Intel1
Employee
1,202 Views

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.

0 Kudos
Rodrigues__Pedro
Beginner
1,202 Views

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

0 Kudos
Reply