files on substituted drives unavailable in windows 8 ?

files on substituted drives unavailable in windows 8 ?

I have a dual boot system with windows 7 and windows 8.

Both have visual studio professional 2012 with IVF composer XE 2013sp1. Both systems know to the same physical drive as drive E:. On both I execute a dos command "subst P: E:\map1\map2". On Both systems in the explorer and in a dosbox i get the same result when I inspect the directory p:\ or  E:\map1\map2\. My Fortran project/solution/sources and bin etc. are on the same drive E:\. The same exe is build (as far as i can see) weather build under windows 8 or under windows 7.  Both executables (build under win8 amd under win7) can run under win 7 and under win 8.

They both show the following:

In both systems my fortran programs can see a file (test.txt) in map E:\map1\map2\ for instance in an INQUIRE statement. 

Under windows 7 the same Fortran program will report that file also as existing in map P:\

Under window 8  the same Fortran program will report that file also as NOT existing in map P:\

How can I use files on a substituted drive under windows 8? Please advise me.

Jan Jaap

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

Where is the file, Win8 has more "protected" file areas than Win7

Out of interest You could try the windows api function FindFirstFile to see if that "sees" the file. The OS might alias the files name in some way for mapping thing.

USE ifwin
integer(handle) :: fwnd
TYPE (T_WIN32_FIND_DATA) lpFindFileData
fwnd=FindFirstFile("myfullfilepathstring"C,  lpFindFileData)



I was unable to reproduce the problem described on a Windows 8.1 X64 system, using a program that opens a formatted data file in the same directory as the source and Exe files. Perhaps you can give specific details such as the full content of the INQUIRE statements in the two scenarios (original and virtual drives used). In particular, do you use just the name of the file or the full path in your program?

As I got errors on opening files I used this fixed-form-code to see if the files were visible:

      PROGRAM WhereIsMyFile1
      CHARACTER*40 cNAMeeee,cNAMpppp
      Logical*1 lIseeee,lIspppp
      INQUIRE (FILE=cNAMeeee,EXIST=lIseeee)
      INQUIRE (FILE=cNAMpppp,EXIST=lIspppp)
	      if (lIseeee) then
        WRITE (UNIT=*,FMT=*)
     1  'I could find '//cNAMeeee
       WRITE (UNIT=*,FMT=*)
     1  'I could NOT find '//cNAMeeee
      end if
	      if (lIspppp) then
        WRITE (UNIT=*,FMT=*)
     1  'I could find '//cNAMpppp
       WRITE (UNIT=*,FMT=*)
     1  'I could NOT find '//cNAMpppp
      end if


I ran your program (with the paths modified to suit my installation, since there is no E: drive here). It gave:

s:\lang>subst p: s:\lang\MKL

s:\lang>cd \

 I could find S:\lang\mkl\MyFile.txt
 I could find P:\MyFile.txt


I think there is something (setting? / privilege?)  under windows 8 that I am not aware of.


I discovered that running MVS under my account (had administrator rights) CAN see the substituted file.

When I start a project in the MVstudio it offers to restart the application and run under elevated permissions. When I do that the program can NOT see the file. The MVS does restart, but does not prompt to change my user account (as mentioned in the popup), it just restarts with apparently lower permissions.

If you disabled UAC you might find you will be able to do what you want. It might be worth a quick test but is not a solution as  the computer will be more vulnerable to attack and viruses. 

Under curiosity, what happens if instead of subst you use map network drive? You will have to attribute the folder as shared first.

Right-Click on MyComputer to get to Map Network Drive.

Jim Dempsey

Leave a Comment

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