View previous topic :: View next topic |
Author |
Message |
Bartl
Joined: 16 Oct 2009 Posts: 58 Location: München
|
Posted: Tue Jul 13, 2010 8:16 am Post subject: store fix parameters for a program |
|
|
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 |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7925 Location: Salford, UK
|
Posted: Tue Jul 13, 2010 8:46 am Post subject: |
|
|
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...
Code: | character*256 getenv@, path
path=getenv@("PATH")
print*, path
end |
|
|
Back to top |
|
|
Bartl
Joined: 16 Oct 2009 Posts: 58 Location: München
|
Posted: Wed Jul 14, 2010 2:46 pm Post subject: |
|
|
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? |
|
Back to top |
|
|
|