Silverfrost Forums

Welcome to our forums

store fix parameters for a program

13 Jul 2010 7:16 #6610

Paul, i want to use the nodepad.exe in a program with 'start_process@', that works fine. But therefor i need the path, were nodepad.exe is to be find. Because this can be different on each computer i tried to set a environment variable but i am not able to read this variable with getenv@.

Can you give me a short example how to do this?

Or is there a better way to solve my problem? Thanks

13 Jul 2010 7:46 #6613

If you use start_process@ or better start_pprocess@ then the PATH environment variable is copied to environment of the process.

On most machines notepad.exe will already be on the PATH. This being the case, you should be able to launch notepad.exe without supplying its full path.

If you still need a sample, here it is...

character*256 getenv@, path
path=getenv@('PATH')
print*, path
end
14 Jul 2010 1:46 #6630

Hello Paul, now I understand the function, it works fine, thanks for your prompt response.

But I have still another question: If I use the %ss code for save settings to a ini file, the storage path is different between XP und VISTA/Windows7. in XP: c:\windows\??.ini in VISTA: c:\Users\Media\AppData\Local\VirtualStore\Windows\??.ini

although the path %systemroot% is equal on both machines with c:\windows.

Is it possible to read out the correct storage path with fortran under XP and VISTA/Windows7?

Please login to reply.